Fw: smbclient in bash with spaces in share path

Jorge Bastos mysql.jorge at decimal.pt
Wed Jun 6 17:14:35 GMT 2007


Use:

---
common\\Incoming\ faxes\\testsh\\$FILENAME.txt
or
common\\"Incoming faxes"\\testsh\\$FILENAME.txt
---

One of those i think it works


----- Original Message ----- 
From: "Zev Spitz" <shivisi at nana.co.il>
To: <smb-clients at lists.samba.org>
Sent: Wednesday, June 06, 2007 3:06 PM
Subject: smbclient in bash with spaces in share path


> Hello all,
> I am new to Linux and Samba.
> I am trying to write a script to put received faxes from a FC6 computer
> to a WinXP share. Bash seems to build the command properly, as is
> reported by the smbclient error, but although the command works from the
> command-line, it doesn't work when passed together with smbclient.
> I don't know if this is something with smbclient, or with bash.
> 
> --- Script:
> #!/bin/bash
> i='/home/zevi/My.planner'
> FILENAME=`basename $i`
> COMMAND="put $i "\""common\\Incoming faxes\\testsh\\$FILENAME.txt"\"
> "smbclient //windows2/shareddocs -N -c '$COMMAND'"
> 
> --- Output:
> test6.sh: line 5: smbclient //windows2/shareddocs -N -c 'put
> /home/zevi/My.planner "common\Incoming faxes\testsh\My.planner.txt"': No
> such file or directory
> 
> --- Trace+Output:
> + i=/home/zevi/My.planner
> ++ basename /home/zevi/My.planner
> + FILENAME=My.planner
> + COMMAND='put /home/zevi/My.planner "common\Incoming
> faxes\testsh\My.planner.txt"'
> + 'smbclient //windows2/shareddocs -N -c '\''put /home/zevi/My.planner
> "common\Incoming faxes\testsh\My.planner.txt"'\'''
> test6.sh: line 5: smbclient //windows2/shareddocs -N -c 'put
> /home/zevi/My.planner "common\Incoming faxes\testsh\My.planner.txt"': No
> such file or directory
> 
> --- Note:
> The following command works fine, when typed into the command line:
> smbclient //windows2/shareddocs -N -c 'put /home/zevi/My.planner
> "common\Incoming faxes\testsh\My.planner.txt"'
> 
>


More information about the smb-clients mailing list