Networker

[Networker] Running mminfo in bourne shell -- SOLVED!

2004-11-02 10:11:56
Subject: [Networker] Running mminfo in bourne shell -- SOLVED!
From: George Sinclair <George.Sinclair AT NOAA DOT GOV>
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Date: Tue, 2 Nov 2004 10:14:11 -0500
Thanks to all who responded. It turns out that the solution, as many
have suggested, is to simply use double quotes. What was confusing me
was that I was trying to use double quotes inside the single quotes
which doesn't work. As others have already said, the shell does not
expand the variable when inside single quotes.

I was somehow under the impression that the mminfo command required the
use of single quotes when using -q or -r, but it appears that double
quotes can be used instead. So, something like

date=$1
mminfo -s server -q "pool=poolname,savetime>=$date"

works like a champ, requiring no double quotes on the variable or when
passing the variable. But I guess placing double quotes around $1 and/or
when passing wouldn't hurt.

Interestingly, however, I have foud at least one situation where double
quotes don't work.

The following command runs fine:

mminfo -s server -a -r "volume,%used,pool,location" -q '!full'

but if I replace the single quotes with "!full" it says:

sh: !full: event not found.

Now, I guess you'd just have to use an 'if' condition in your script and
have each choice hard coded for either 'full' or '!full' rather than
having a variable whose value was either 'full' or '!full'. Hmm ...

George

Kevin wrote:
>
> At 01:19 PM 11/1/2004 -0500, you wrote:
> >Hi,
> >
> >I'm trying to run mminfo command inside a bourne shell script as:
> >
> >date=$1
> >mminfo -s server -q 'pool=poolname,savetime>=$date'
>
> Have you tried a different name other than date?  Remember that the 'date'
> command is
> generally available inside a script.  Just stating the obvious, but...
>
> Kevin

--
Note: To sign off this list, send a "signoff networker" command via email
to listserv AT listmail.temple DOT edu or visit the list's Web site at
http://listmail.temple.edu/archives/networker.html where you can
also view and post messages to the list. Questions regarding this list
should be sent to stan AT temple DOT edu
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

<Prev in Thread] Current Thread [Next in Thread>