Re: [Networker] How to get a list of license enablers on Linux
2009-05-14 14:45:12
> From: "Werth, Dave" <dave.werth AT GARMIN DOT COM>
> Reply-To: EMC NetWorker discussion <NETWORKER AT LISTSERV.TEMPLE DOT EDU>,
> "Werth,
> Dave" <dave.werth AT GARMIN DOT COM>
> Date: Thu, 14 May 2009 11:36:20 -0700
> To: <NETWORKER AT LISTSERV.TEMPLE DOT EDU>
> Subject: Re: [Networker] How to get a list of license enablers on Linux
>
>> -----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, thanks for your feedback, but I copy and pasted the script from the
file on my Solaris box to a file on my Linux box. I understand what you are
saying, but I don't see where the missing quote should go. Putting it at the
end of the last line as you suggested results in the same error message I
received before, so I don't think that's it.
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
|
|
|