string containing double quotes

string containing double quotes

Post by Keith Cockbur » Mon, 23 Jul 2001 23:45:34



Many thanks to Michael Heiming for his prompt reply (as follows)

'bkfiles="directory1 directory2 \"My Documents\" directory4"'
'echo $bkfiles'
directory1 directory2 "My Documents" directory4

Although this works when I plug this into smbclient as follows -

smbclient //$user/c$ password -U username -Tc - $bkfiles | gzip > $opfile

smbclient correctly backs up directory1, directory2 and directory4 but also
attempts to back up the two directories "My and Documents".

If I type the following -

smbclient //$user/c$ password -U username -Tc - directory1 directory2 "My
Documents" directory4 | gzip > $opfile

all four directories (including My Documents) is backed up. Can anyone help.

Many thanks.

 
 
 

string containing double quotes

Post by Bill Marcu » Tue, 24 Jul 2001 09:29:29



Quote:>Many thanks to Michael Heiming for his prompt reply (as follows)

>'bkfiles="directory1 directory2 \"My Documents\" directory4"'
>'echo $bkfiles'
>directory1 directory2 "My Documents" directory4

>Although this works when I plug this into smbclient as follows -

>smbclient //$user/c$ password -U username -Tc - $bkfiles | gzip > $opfile

>smbclient correctly backs up directory1, directory2 and directory4 but also
>attempts to back up the two directories "My and Documents".

Type "$bkfiles" instead of $bkfiles.

 
 
 

1. String containing double quotes

I am trying to create a variable which is a list of directories to be backed
up using smbclient. Some of these directory names include a space so I need
to put " " around the name of the directory.

Is it possible to include " (double quotes) within this string. For example:

bkfiles="directory1 directory2 "My Documents" directory4"

Any help would be appreciated.

Keith

2. sharing cdrom resources

3. Q: sh: Can I quote '"' in a double quoted string?

4. Tuning Async IO

5. Double quotes within double quotes (no apostrophes)

6. syslogd bootup problems ...

7. quoted strings within quoted strings

8. remounting /

9. passing double-quoted string as C program arg

10. Sed question - prepend to double quoted strings

11. replace single quote to double quote with an example

12. Problem in sed using double quotes and single quotes

13. ? about single quote-double quote