LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-30-2004, 10:50 AM   #1
dennis_89
LQ Newbie
 
Registered: Jun 2004
Posts: 27

Rep: Reputation: 15
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
 
Old 06-30-2004, 01:14 PM   #2
Goala
Member
 
Registered: May 2004
Location: Merida (Spain)
Distribution: Debian
Posts: 89

Rep: Reputation: 15
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash script Linh Programming 4 04-21-2004 05:19 PM
send automatic input to a script called by another script in bash programming jorgecab Programming 2 04-01-2004 12:20 AM
bash script - incrementing a filename in a script tslinux Programming 10 08-05-2003 11:58 PM
bash script brian0918 Programming 7 06-12-2003 06:06 PM
bash script prob: how can i tell the script that a 'dd' has finished? Frustin Linux - General 2 04-02-2003 05:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration