Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following script:

NOW=$(date +"%d_%m_%Y")
SMBCLIENT="$(which smbclient)"
for db in $DBS
  echo $FILE
  PARM="prompt; recurse; mput $FILE; exit;"
  for f in $FILE
    $SMBCLIENT // -A $BACKUP/.smbclient -c "\""$PARM"\$

When i execute the script, i only get "Domain=[SEGCAT] OS=[Windows 8.1 Pro 9600] Server=[Windows 8.1 Pro 6.3]" and the file doesn't get copied.

If i echo the $smbclient line, and copy and paste it directly, it copies the file perfectly. I don't know what's happening, it doesn't make sense to me.

EDIT: the fix was to replace the $SMBCLIENT line with: $SMBCLIENT // -A $BACKUP/.smbclient -c "prompt; recurse; mput $FILE; exit;"

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.