Search code examples
linuxbashdebianphingsdiff

Linux sdiff command cut output text


I have two files which I compare using sdiff command. Unfortunately it cuts filename, which is necessary for me.

Command looks like that:

sdiff -t ${build.fileListDir}/${build.fileList} ${build.dir}/git/${build.fileList} | grep '[|]' > ${build.dir}/git/modifiedFiles.txt

${} -> are replaced with normal characters (Phing).

Anyway the output looks like that:

a4f0dc8026624beec687c6b74e5adc46  ./1_modified_file.txt         |  c25f670976fae1b4cf5359fe833267ba  ./1_modified_file.txt
c03bd9d37a79c5527ea74bff9e186d9a  ./build.xml                   |  c08855177f74176b278f915f16faff85  ./build.xml
000efe64d6298094cdc5fffa33b11e55  ./src/Dgafka/BookStore/Applic |  000efe64d6298094cdc5fffa33b11e55  ./src/Dgafka/BookStore/Applic

Like you can see the part "./src/Dgafka/BookStore/Applic" is cutted off.

I don't see any options for sdiff to print whole lines.

I would be gratefull for help.


Solution

  • sdiff is splitting the output equally between two columns - the "-w" option gives the maximum width (default 130). Add "-w" with a wider limit to see more, e.g., "sdiff -w 512".