LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   bash script help (https://www.linuxquestions.org/questions/linux-networking-3/bash-script-help-199500/)

dennis_89 06-30-2004 10:50 AM

bash script help
 
I am having trouble with a bash script, here is the code:

Code:

#!/bin/bash
#--------------Environment variables for laptop--------------------
USERNAME1=Doug Milburn
PASSWORD1=hello
#
DRIVE=/var/autofs/zip.1/zip.1
#
TARGET_MACHINE=Doug
#
mkdir $DRIVE/$TARGET_MACHINE
cd $DRIVE/$TARGET_MACHINE
#
smbclient //$TARGET_MACHINE/Outlook $PASSWORD1 -U $USERNAME1 -c "recurse;prompt;mget *;"
#
tar cvpz $DRIVE/$TARGET_MACHINE > Doug_c.tar.gz
rm -rf $DRIVE/$TARGET_MACHINE
#


I get an error like it is trying to connect to smb right after this line:

smbclient //$TARGET_MACHINE/Outlook $PASSWORD1 -U $USERNAME1 -c "recurse;prompt;mget *;"

this is what happens, I get this:

smb>


Does anyone have any ideas? Does it have anything to do with the space in the username??

Thanks,

Dennis

Goala 06-30-2004 01:14 PM

Hi dennis, I think so (the space in USERNAME killed JFK :))

use:

USERNAME1="Doug Milburn"
or
smbclient //$TARGET_MACHINE/Outlook $PASSWORD1 -U "$USERNAME1" -c "recurse;prompt;mget *;"

If you don't quote the user name you are passing an extra parameter to smbclient command.

Bye.


All times are GMT -5. The time now is 08:25 PM.