PDA

View Full Version : diff: Argument list too long



dragos2
April 30th, 2010, 10:18 AM
Hi friends, I need some help with this little script: it says argument list too long probably
because the awk outputs everything on one line.



diff $(awk '{print $8}' f1.txt) $(awk '{print $8}' f2.txt)


Neither this works:


a=$(awk '{print $8}' f1.txt)
b=$(awk '{print $8}' f2.txt)
diff "$a" "$b"


Any idea of how to fix this besides outputting those awks to separate files and diff from there ?

iponeverything
April 30th, 2010, 10:47 AM
man diff:

DIFF(1) User Commands DIFF(1)

NAME
diff - compare files line by line


note the "compare files" part. As in two files.

dragos2
April 30th, 2010, 11:10 AM
man diff:


note the "compare files" part. As in two files.

Ups, I did not knew that. Thanks