how can i use single quote in smbclient "put" command?
For example:
smbclient -c 'put "/mydir/video.avi" "\Music\Guns N' Roses\video.avi"'
The ' in "Guns N' Roses" generate an error, but i cannot use "Guns N\' Roses", because will change path.
how can i use single quote in smbclient "put" command?
For example:
smbclient -c 'put "/mydir/video.avi" "\Music\Guns N' Roses\video.avi"'
The ' in "Guns N' Roses" generate an error, but i cannot use "Guns N\' Roses", because will change path.
Your shell doesn't allow use of escaped single quotes inside a single-quoted string. Read the section entitled "QUOTING" in
man bash
(assuming your shell is bash).You need to escape the inner single quotes outside the single-quoted string:
Or, if you prefer:
Or alternately, you could put things in variables, use formatting, etc. Obviously I haven't tested this in your environment, but the following seems reasonable to me: