Spaces in filenames (was: shell script question)

Jason Stephenson jason at sigio.com
Tue Jan 21 11:52:49 EST 2003


I don't disagree with the use of the word "broken" and I think your 
analogy misses the mark by a long shot. There is nothing "broken" in 
your description of the conventions of driving. You are simply 
describing how something. It's like you're saying what characters are 
and are not allowed in file and path names on POSIX-conforming systems.

In the case of a shell script that fails to properly quote arguments, 
there is something broken. The script's author failed to properly 
interpolate variable arguments into strings and as a result the script 
does not handle input that is formatted correctly according to the file 
and path naming conventions in a graceful manner. Spaces are valid 
characters and allowed in file and path names, and any script which does 
not allow for spaces in file and path names is therefore "broken" in 
regard to the convention of UNIX file naming.

A proper analogy would be having a vehicle on the road without turn 
signals or without brakes. Such a  vehicle is very difficult to use in a 
way that follows the conventions of good driving which Mr. Abreau describes.

By the way, it is very easy to handle spaces in file names in shell 
scripts. Simply put double quotes (") around all variable substitutions 
that will be used as strings. Most shells even do the right thing with 
numeric values bracketed by double quotes.


John Abreau wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Content-Type: text/plain; charset=us-ascii
> 
> bscott at ntisys.com writes:
> 
> 
>>  That being said, choosing to not put spaces in filenames to work around
>>broken software does not thus make spaces bad.  As you've already stated, it
>>is the software that is broken.  Sometimes, we have to live with broken
>>things.  That doesn't mean we should consider broken things good.  Doing so
>>is a sure way to kill progress.
> 
> 
> I disagree with the use of the word "broken" here. You could apply these 
> same arguments to driving; for instance, we're required to drive on the 
> right-hand side of the road, and to come to a stop at red traffic lights. 
> While this limits our "freedom" to drive all over the road and run through 
> red lights, that's not cause to describe automotive technology as 
> "broken".
> These are the conventions we use to make driving manageable, just as 
> using whitespace to separate words on the command line is a convention 
> for managing command-line interaction in Unix. "Broken" is not an 
> appropriate word to describe it.
> 
> 
> - --
> John Abreau / Executive Director, Boston Linux & Unix
> Email jabr at blu.org / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9
> PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (GNU/Linux)
> Comment: Exmh version 2.5 07/13/2001
> 
> iQCVAwUBPiylVVV9A5rVx7XZAQJxRwQAnVfNjVJrvhQ6RRiIW+/mgvX10XLn1H4r
> +3VtETNf8NTPHhJKTq165vtd7gItM3Y0C88APpJkfV2SCMIDAdQhxPIdNFqMTd8Q
> Pwzg5b7rVBDPaF/BaiGCHo2lCYuLF9tDirQdQQAA2hnjZEAdP8c9JvdeeYMOcAxT
> b3BrrW73dV4=
> =uIo+
> -----END PGP SIGNATURE-----
> 
> _______________________________________________
> gnhlug-discuss mailing list
> gnhlug-discuss at mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
> 




More information about the gnhlug-discuss mailing list