Networker

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

2004-11-02 11:04:18
Subject: Re: [Networker] Running mminfo in bourne shell -- SOLVED!
From: Itzik Meirson <imeirson AT MBI.CO DOT IL>
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Date: Tue, 2 Nov 2004 18:02:23 +0200
That is because the "!" is a shell meta-character that is always
evaluated.
You can try to avoid its default "meaning" by escaping it with a "\".
Itzik 

-----Original Message-----
From: Legato NetWorker discussion [mailto:NETWORKER AT LISTMAIL.TEMPLE DOT EDU]
On Behalf Of George Sinclair
Sent: Tuesday, November 02, 2004 17:14
To: NETWORKER AT LISTMAIL.TEMPLE DOT EDU
Subject: [Networker] Running mminfo in bourne shell -- SOLVED!

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
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

**************************************************************************************************
The contents of this email and any attachments are confidential.
It is intended for the named recipient(s) only.
If you have received this email in error please notify the system manager or  
the 
sender immediately and do not disclose the contents to any one or make copies.

MBI - System Team
**************************************************************************************************

--
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>