On Fri, 21 Feb 2003 at 10:46pm (-0600), Kerry Miller wrote:

> Ok, I'm a network guy, not a software guy.  I'm even lousy at bash scripts, 
> but here's a question.
> 
> I can get to a share from my windoze machine using smbclient and copy files 
> back to the linux box.  I don't know how to put it into a script 
> though.  Here's what I've got:
> 
> smbclient //kmiller/temp -U username%password
> get <filename>
> quit
> 
> When I do it manually, it works fine (assuming I put the real username, 
> password and filename in).  I need to know how to tell the script to wait 
> for the prompt from the windoze box before it sends the next line.  I tried 
> "sleep 5" but that didn't work.  When I run the script, I get the smb 
> prompt from the windows machine, then it stops.
> 
> This can't be too tough, I'm just no good at scripting.  I'd appreciate 
> some hints, or a place to RTFM would work!
> 

I think you want the -c option to smbclient....

    -c command string
           command  string  is a semicolon-separated list of commands to be
           executed instead of prompting from stdin.  -N is implied by -c.
           This is particularly useful in scripts and for printing stdin to
           the server, e.g. -c 'print -'.

... so you might have something like....

smbclient //kmiller/temp -U username%password -c "get $filename"

M.

-- 
WebCentral Pty Ltd           Australia's #1 Internet Web Hosting Company
Level 5, 100 Wickham St.           Network Operations - Systems Engineer
PO Box 930, Fortitude Valley.                     phone: +61 7 3249 2552
Queensland, Australia 4006.                       pgp key id: 0x900E515F



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to