Re: Spaces in file and directory names.



Gisli Ottarsson <gisli@master.adams.com> writes:

> Many UNIX utilities (and legacy shell scripts) do not gracefully
> handle spaces in file names.  [...]
> 
> This is why I think spaces in file names are a bad idea and this is
> why I expressed the hope that none of the standard gnome directories
> and file names would contain spaces.

I think this is good advice.  We've had problems trying to get make to
cope with directories containing spaces too ("Program Files" on win32,
specifically).  In general, avoiding spaces and other special
characters in file and directory names will lead to fewer surprises.

It's not just legacy shell scripts, either.  As has been pointed out,
even modern ksh does the word splitting at the wrong time, so setting
a variable file_list so that the following works as you'd expect can
be non-trivial if some of the filenames contain spaces:

	ksh$ for i in $file_list
	     do
                echo $i
             done

I think zsh is right to be incompatible with other shells in this
case.

On the other hand, it's nice sometimes to be able to give documents,
spreadsheets and so on meaningful names with spaces and apostrophes in
them.  So although it would be good for the standard files and things
to have safe names, applications like gwp, gnumeric, and so on
shouldn't constrain my choice.  Nothing that's newly written ought to
break on these filenames: if something old does, then that's a bug to
be fixed, not a reason for writing new broken code.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]