Hello listmembers,
I'm trying to write a bash script to change the location of many tapes in
our library. I can get the mmlocate command to run manually, but not via script.
My script currently looks like this:
--code--
#!/bin/bash
newloc="'Some New Location'"
sudo /usr/sbin/nsr/mmlocate -u -n ourbackup1.001 $newloc
sudo /usr/sbin/nsr/mmlocate -u -n ourbackup1.002 $newloc
sudo /usr/sbin/nsr/mmlocate -u -n ourbackup1.003 $newloc
sudo /usr/sbin/nsr/mmlocate -u -n ourbackup1.004 $newloc
--code--
This is just a small part of the whole thing, but you get the idea.
I run sudo on some random command just prior to running this script so it
operates without another password check. If I add an 'echo' in front of each
line, I get the correct output, and if I then copy one of the echo'd lines
to a command prompt & hit enter, it works fine. When I run the script I get
mminfo's 'bad input' response, i.e.:
usage: mmlocate [ -s server ] [-l] [ -n name | -i id | location ]
or mmlocate [ -s server ] -L
or mmlocate [ -s server ] -d location
or mmlocate [ -s server ] -c { -n name | -i id }
or mmlocate [ -s server ] -u { -n name | -i id } location
usage: mmlocate [ -s server ] [-l] [ -n name | -i id | location ]
or mmlocate [ -s server ] -L
or mmlocate [ -s server ] -d location
etc....
We're using Networker 7.2 on Solaris 9.
Any ideas?
thanks,
Ben Wall
American University
bwall AT american DOT edu
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
|