Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I don't get the difference between the program lam

lam -- laminate files
The lam utility copies the named files side by side onto the standard output. The n-th input lines from the input files are considered fragments of the single long n-th output line into which they are assembled. The name `-' means the standard input, and may be repeated.

and paste

paste -- merge corresponding or subsequent lines of files
The paste utility concatenates the corresponding lines of the given input files, replacing all but the last file's newline characters with a single tab character, and writes the resulting lines to standard output. If end-of-file is reached on an input file while other input files still contain data, the file is treated as if it were an endless source of empty lines.

Except for the command options. I don't get the difference. Suppose I have two files a and b

a
------------
1
2
3

b
------------
4
5
6

I get

$ paste -d ',' a b
1,4
2,5
3,6

$ lam a -s',' b
1,4
2,5
3,6

They seem redundant in scope, although lam seems to be more flexible. The descriptions do not allow me to catch cases where they could behave differently. Does anybody have a clue ?

share|improve this question
3  
They are redundant in scope. lam was part of BSD, paste AT&T. paste was later standardized in POSIX.2. lam hangs around for hysterical reasons. TIMTOWTDI –  Richard Hoskins Jul 29 '09 at 17:18
add comment

1 Answer

paste applies to complete files. Therefore it will concatenate complete files into a single file. Lines will be merge if they are the same.

lam applies to lines in a file as well as files. Therefore you can selectively concatenate lines into a new file.

share|improve this answer
1  
Interesting, I have mostly used join for these things. linux.about.com/library/cmd/blcmdl1_join.htm –  nik Jul 29 '09 at 15:27
    
@nik. So do I - Or I just do a copy –  Diago Jul 29 '09 at 15:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.