+++ Marc Haber [26/01/07 16:56 +0100]:
On Tue, Jan 23, 2007 at 01:27:37PM -0500, Mike O'Connor wrote:
diff -ru nagios2-2.6.orig/debian/nagios2-common.nagios2.init 
nagios2-2.6/debian/nagios2-common.nagios2.init
--- nagios2-2.6.orig/debian/nagios2-common.nagios2.init 2007-01-23 
13:26:04.000000000 -0500
+++ nagios2-2.6/debian/nagios2-common.nagios2.init      2007-01-23 
13:26:17.000000000 -0500
@@ -114,7 +114,7 @@
   exit 6
 fi
-THEPIDFILE="$(grep lock_file $NAGIOSCFG | awk '{print $2}' FS="=")"
+THEPIDFILE="$(grep lock_file $NAGIOSCFG | awk 'BEGIN{FS="="}{print $2}')"

Would you be satisfied with
awk -v FS="=" '{print $2}'
as well?

I seem to have inadvertently used a construction that is not awk
standard, but mawk and gawk handle it just fine. The -v stuff should
be standard-compliant, isn't it?

Greetings
Marc

yeah, works for me:

:) [EMAIL PROTECTED]:~ $ readlink -f (which awk)
/usr/bin/original-awk
:) [EMAIL PROTECTED]:~ $ awk -v FS=":" '/stew/{print $2}'</etc/passwd
x
:) [EMAIL PROTECTED]:~ $
thanks,
stew

Attachment: signature.asc
Description: Digital signature

Reply via email to