[Samba] A question about environmental variables and samba

William Beilstein wbeilstein at raymourflanigan.com
Fri Jul 16 15:17:22 GMT 2004


I am new to samba and I have a question.

I have the following command file I am passing to the Samba client (Version
2.0.7).
=========================
#!/bin/ksh
#set -xv

# Variable one represents the name of the resulting command file
# Variable 2 is the name of the source file spooled to adhoc by the sql
script.
# Variable 3 is the name of the file, as it will be called on the staged
directory

 echo "cd DSRP" > $ORACLE_HOME/adhoc/$1
 echo "cd Database" >> $ORACLE_HOME/adhoc/$1
 echo "cd Active" >> $ORACLE_HOME/adhoc/$1
 echo "get $2 $GERS_HOME/datafiles/$3" >> $ORACLE_HOME/adhoc/$1

/usr/local/samba/bin/smbclient //rfdata/OPS -Uxxxxxxx%pppppppp <
$ORACLE_HOME/adhoc/$1
=================================

rm $ORACLE_HOME/adhoc/$1


My problem is that the client doesn't expand out the environmental variable
$GERS_HOME, it treats it like a literal string and attempts to save the file
in the

'$GERS_HOME/datafiles' directory (which doesn't exist) instead of the
'/gers/test/datafiles' directory. The script is run by a number of different
instances so that I can't hard code a path in the script.

Does samba not understand ENV Vars, or is there a special syntax to use
them.



More information about the samba mailing list