Anis_Stack
Anis_Stack

Reputation: 3452

tcl : compare 2 file with diff and grep the output

I would like to compare 2 file and show the difference between files

when I use the following :

exec sh -c "diff -w file1 file2 \|grep \<"

but no result is shown and the script is brokeen

what's wrong with the tcl command ?

Upvotes: 1

Views: 1824

Answers (1)

Brad Lanam
Brad Lanam

Reputation: 5763

The following will work:

puts [exec sh -c "diff -w file1 file2 |grep \\<"]

The < needs to be double-backslashed, and the output should be printed.

Upvotes: 3

Related Questions