Say I have two files where there is one number per line
File 1 file 2
0.12 0.11
0.121 0.454
.... ....
I want to create file or output difference between each number on to the screen, so that result looks like
0.0099
-0.333
......
You can use bash/awk/sed
awk
Explanation:
getline t <"file1"gets a line fromfile1and puts its value to variablet.$0is the current record offile2that awk is processing. the rest is just subtraction and printing the result out.Bash