[ale] sh script problem
Michael Phillips
mike at coosavalley.net
Thu Sep 21 16:33:55 EDT 2000
I am attempting to write a script that will redirect the output of tree to a
file for further processing. For the curious, the files are located on a
wincrap server and I am mounting the shares via my Linux workstation. The
script looks like this:
#!/bin/sh
MNTDIR="/ntdrive"
USERNAME="bigkahuna"
PASSWORD="password"
RESULTS="/root/scripts/ntshares"
>$RESULTS
echo "NT Share Scan. Performed on:" >> $RESULTS
date >> $RESULTS
echo "---------------------------------" >> $RESULTS
echo "" >> $RESULTS
for i in `cat ntdrives.list`
do
echo "Cataloging $i for directory listing" >> $RESULTS
mount -t smbfs -o username=$USERNAME,password=$PASSWORD //$i $MNTDIR
cd $MNTDIR
tree -as >> $RESULTS
cd /
umount $MNTDIR
echo "" >> $RESULTS
done
ntshares contains:
/ntserver/Linux Security
/ntserver/Chip's Stuff
/ntserver/This-Is-Important
The third share mounts fine so I am suspecting that the whitespace has
something to do with being unable to mount the other two shares. I have
tried the following variations, yet the script still craps out for the Linux
Security and Chip's Stuff shares:
"/ntserver/Linux Security"
'/ntserver/Linux Security'
`/ntserver/Linux Security`
""/ntserver/Linux Security""
What am I doing wrong?
TIA
Thanks
Mike
------------------------------------------------------------------------
Michael Phillips UNIX Administrator
<mike.phillips at ieionline.com > Phone: 256-362-8562 Ext 143
International Enterprises, Inc. Fax: 256-362-0102
108 Allen St http://www.ieionline.com
Talladega, AL 35160 "Superior Avionics for the Military"
DISCLAIMER: Opionions expressed are not neccessarily those of my employer
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
More information about the Ale
mailing list