Skip to Content
Linux Shell Scripting Cookbook - Third Edition
book

Linux Shell Scripting Cookbook - Third Edition

by Clif Flynt, Sarath Lakshman, Shantanu Tushar
May 2017
Beginner
552 pages
28h 47m
English
Packt Publishing
Content preview from Linux Shell Scripting Cookbook - Third Edition

How to do it...

The paste command performs column-wise concatenation:

    $ paste file1 file2 file3 ...

Here is an example:

    $ cat file1.txt
    1
    2
    3
    4
    5
    $ cat file2.txt
    slynux
    gnu
    bash
    hack
    $ paste file1.txt file2.txt
    1 slynux
    2 gnu
    3 bash
    4 hack
    5

The default delimiter is tab. We can specify the delimiter with -d:

    $ paste file1.txt file2.txt -d ","
    1,slynux
    2,gnu
    3,bash
    4,hack
    5,
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Linux Shell Scripting - Second Edition

Mastering Linux Shell Scripting - Second Edition

Mokhtar Ebrahim, Andrew Mallett

Publisher Resources

ISBN: 9781785881985