My AWK script will change $2 and $3 based on the value of $1.
The values in $1 are distinct and must match to one of the values in the first column with every call to this script.
What I'm wondering how to do is to test if the AWK code successfully completed.
If I call $? I always get a status of 0 (since the cat does work fine).
How do I verify that the AWK code did not error out?
I have to take whatever data is in csv_file.csv (orig. file) and carry it through to the tmp file (tmp_file.csv). I need to move the entire 'file' which consists of many 'records' and only change the data in position 2 and 3 on a match to the data in position 1.
The print outside of the IF statement in the awk code allows all data to pass through to the tmp file, so even when the IF statement fails (awk) I still get a file with all data, but no match.
Was hoping to catch this in the awk statement. Guess I'll need to write more code to catch this type of error earlier.