Suppress awk warnings

awk, shell scripts, suppress warnings, warning

Thread Tools Search this Thread
# 1  
Old 07-29-2008
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...).


# 2  
Old 07-29-2008
Hammer & Screwdriver Without seeing your command text, here is a possible solution:

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.

Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Subroutine redefined warnings with require keyword chu816 Shell Programming and Scripting 1 02-17-2012 09:53 PM
executing script shows some warnings rahul125 Shell Programming and Scripting 9 10-21-2011 12:37 AM
Boot failure - Warnings for /etc/major_to_minor and /etc/driver_aliases psychocandy Solaris 10 04-13-2011 10:03 AM
How to handle errors and warnings stunnerz_84 Shell Programming and Scripting 1 10-19-2010 02:52 AM
Warnings in AIX vin_pll AIX 1 04-24-2009 12:38 AM
Not getting warnings!! amit_27 Solaris 0 02-09-2009 09:49 AM
How to suppress minor C compiler warnings speedos82 UNIX for Dummies Questions & Answers 4 10-06-2008 06:29 AM
/etc/syslog.conf file and warnings jeffpas AIX 3 07-14-2008 03:47 PM
need to extract warnings and cautions ScotRite Shell Programming and Scripting 4 05-04-2008 09:21 PM
Sysback Warnings daveisme AIX 2 01-09-2008 10:50 AM
gcc warnings: implicit declaration of function... Ahsan Programming 2 08-29-2003 11:15 PM