I have a file (status.file) of the form:
valueA 3450
valueB -20
valueC -340
valueD 48
I am tailing a data.file, and need to search and modify a value
in status.file...the tail is:
tail -f data.file | awk '{ print $3, ($NF - $(NF-1)) }'
which will produce lines that look like this:
valueB -40
valueD 220
valueA -100
so I think what I would like to do is add a pipe to the tail command,
and send those lines to an awk command/program. It should then
search through status.file, and add the value to the correct line.
For example, using the above status.file, a line of data (after having
gone through the tail line) of
valueC -30
would result in status.file being changed to:
valueA 3450
valueB -20
valueC -370
valueD 48
Any help/tips would be greatly appreciated, thanks