I have an AWK script that has to plow through an access_log (apache web server) and I have a surfer/user (lucky for me he has a fixed ip-address) that produces lines that are longer than 3,000 bytes/characters and then my awk script quits with an error message (don't have the exact wording, but can supply it, if it is necessary).
I can get rid of the lines that are too long using SED, but for now I have to do it all manually.
I want to have a shell script to call (and run) my awk script. If the awk script fails because the input file contains lines that are too long, it should (but only in this case) run my SED script and afterwards run the AWK script again.
My question is: how do I read the exit code of my AWK script? Is there an exit code? My guess is that there might be an exit code greater ZERO if an error occurs.
Anyone know for sure?
I can get rid of the lines that are too long using SED, but for now I have to do it all manually.
I want to have a shell script to call (and run) my awk script. If the awk script fails because the input file contains lines that are too long, it should (but only in this case) run my SED script and afterwards run the AWK script again.
My question is: how do I read the exit code of my AWK script? Is there an exit code? My guess is that there might be an exit code greater ZERO if an error occurs.
Anyone know for sure?