utility

paste — external utility

Combines corresponding lines of files; default separator is tab. -d changes delimiters and -s combines lines of each input in sequence. Unlike join, it matches by position, not key. Missing lines are treated as empty fields. Run in a fresh private directory with HOME set to that directory and LC_ALL=C. Expected output (one item per line): a,1; b,2.

Formal Syntax & Structure

bash syntaxbash
paste [-s] [-d LIST] FILE...

Parameters & Attributes

NameTypeDescription
LISTstringDelimiter characters, cycled as needed.
FILEpathInput text file, or - for stdin.

Return Value

exit status

Zero on successful operation; nonzero on errors.

Working Example

Example Snippetbash
printf 'a\nb\n' > namesprintf '1\n2\n' > valuespaste -d ',' names values
Bash Reference