A file with exactly two words per line, the first word is used as stdin to a program, the second is the expected output of the program. I'm try to separate this file into two files, one contains only the inputs for the program, the other has the expected outputs. I can use only read, cat,echo,ls,cut,[ ],cp,rm.cmp.diff, mv expr, eval, exit, wait,cd,shift commands.
input=echo $1.$$
output=echo $1.$$
while read x y < `cat $1`
do
echo $x >> $input
echo $y >> $output
done
The result of this script should be: file input/ouput contains only the first /second word, one per line, each word has a newline appends to it.
The question is after I run the above script, the input/output is NULL.
Another question is, I have to caculate how many outputs of the program differ from the expected outputs.
I use cmp or diff $1.output $output, I don't know how to caculate the different lines between $1.output and $output. Could you give me an idea?
Thank you very much for your help.