[TriLUG] Backup script... Spaces in path

Tanner Lovelace lovelace at wayfarer.org
Fri Aug 8 13:07:35 EDT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tom Woods wrote:
| I'm writing a backup script, learning as I go...  The problem I am having
| is backing up a Windows system via samba (although I don't think it being
| a Windows system has anything to do with this problem.)  When I pass a
| path  and filename with spaces via $1 or $n to the function, tar sees the
| space as a delimiter, not as a part of the path.  I have tried using ', ",
| and \<space>, nothing seems to work.  I'm sure someone out there knows how
| to accomplish what I need.

I'd suggest surrounding the $1 or $n with double quotes.  Single quotes
will cause them not to be expanded, but with double quotes they should
be expanded and treated as one string.

Tanner
- --
Tanner Lovelace | lovelace(at)wayfarer.org | http://wtl.wayfarer.org/
- --*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--
GPG Fingerprint = A66C 8660 924F 5F8C 71DA  BDD0 CE09 4F8E DE76 39D4
GPG Key can be found at http://wtl.wayfarer.org/lovelace.gpg.asc
- --*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--
~          Si hoc legere scis, nimium eruditionis habes.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQE/M9jUzglPjt52OdQRAkN4AKDBD/49Ed0IkUWFTjhoqezWiTeCZACgrZdr
vfpXMBkNMMqf91etTVgjF2k=
=P50D
-----END PGP SIGNATURE-----




More information about the TriLUG mailing list