1

I am trying to use vimdiff of two files within while loop. But it breaks after 1st loop.

while read line
do
vimdiff -c TOhtml -c wqa! $line"_file1" $line"_file2"
done < inpFile.txt

Though inpFile contains multiple entries, the above loop breaks after 1st loop. I suspect if its because of subprocess. May i know how to get it running for all entries in file.

user3665224
  • 1,349
  • 3
  • 16
  • 34

1 Answers1

2

Redirect so that vimdiff doesn't eat the input intended for the loop:

while read line
do
    vimdiff -c TOhtml -c wqa! $line"_file1" $line"_file2"  < /dev/null
done < inpFile.txt
that other guy
  • 116,971
  • 11
  • 170
  • 194