Networker

Re: [Networker] How to get a list of license enablers on Linux

2009-05-14 14:39:53
Subject: Re: [Networker] How to get a list of license enablers on Linux
From: "Werth, Dave" <dave.werth AT GARMIN DOT COM>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Thu, 14 May 2009 11:36:20 -0700
>-----Original Message-----

>> From: "Werth, Dave" <dave.werth AT garmin DOT com>
>>
>> Stan,
>>
>> I tried this on our Solaris 7 system and got the message:
>>
>>         syntax error at line 4 : `'' unmatched
>>
>> The apostrophe in the awk command needs a match to close the quotation.
>
>Thanks, but it works fine on Solaris 10 and on the Linux version, I tried
>putting a close quote in various places, but the error message remains the
>same ...
>
>./nsr_licenses: line 6: unexpected EOF while looking for matching `"'
>./nsr_licenses: line 7: syntax error: unexpected end of file

Well, that message says it's missing a matching double quote (").  The code in 
your original post was missing a single quote (') at the end.

Here's the code from your message:

echo "show name; enabler code; auth code
    print type:NSR license" | nsradmin -i - | \
egrep -v "^$" | sed -e 's/^[ \t]*//' -e 's/;//g' | \
awk -F":" '($1 ~ /^name*/) { printf("%s ;",$2) }
   ($1 ~ /^enabler*/) { printf("%s ;",$2) }
   ($1 ~ /^auth*/) { printf("%s\n",$2) }[single quote needed here]

A single quote to match the one immediately before [($1 ~ /^name*/)] is needed 
as noted following the final curly bracket on the last line.

The error message you're getting appears to indicate that you didn't properly 
match a double quote when you typed the command on your Linux system.

Needless to say, scripting is totally dependant on getting the matching of the 
various quotes and brackets right.

Dave Werth
Garmin AT, Inc.
Salem, Oregon


This e-mail and any attachments may contain confidential material for the sole 
use of the intended recipient. If you are not the intended recipient, please be 
aware that any disclosure, copying, distribution or use of this e-mail or any 
attachment is prohibited. If you have received this e-mail in error, please 
contact the sender and delete all copies.

Thank you for your cooperation

To sign off this list, send email to listserv AT listserv.temple DOT edu and 
type "signoff networker" in the body of the email. Please write to 
networker-request AT listserv.temple DOT edu if you have any problems with this 
list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER