Suppress awk warnings

Hello everyone,

Sorry if this is a bit of an RTM thing, but I can't find any flags for suppressing warnings with awk and Googling (this site too) didn't yield much useful. Does anyone know how to suppress warnings?

The warning I'm specifically trying to remove is one warning me that I'm escaping a . character (which I intend to be escaping, since I'm removing it...).

Cheers,

Kyle

You can redirect output for standard output and error output. Two examples:

(a) Some commands may echo info back to your screen during/after execution. So, you could do the following

cd mydir 1>/dev/null

Because during a script execution, the extra stuff is distracting.

(b) One that I use all of the time is with cleaning up files. I don't care if the work file doesn't exist in the example

rm mytempfile 2>/dev/null

Another example would be in getting a count of files

filecnt=$(ls -l myftempfile 2>/dev/null | wc -l)

Here I don't care about the error, as filecnt will be set to 0 zero anyway.

So, perhaps you can incorporate some part of this into your awk command.