On Fri, 14 Jan 2011 10:23:54 +0000, Dave Howorth wrote:
> Jim Henderson wrote:
>> On Thu, 13 Jan 2011 10:05:48 +0000, Dave Howorth wrote:
>>
>>> That’s nonsense. Unix has always allowed spaces in names. DOS and
>>> Windows didn’t.
>>
>> Well, it’s not entirely nonsense. While the filesystem has always
>> supported spaces, not all programs deal with them gracefully
>> (especially scripts). Similarly, I can start a filename with “-” but
>> then if I do something like try to delete it, I have to jump through
>> hoops because the shell (since rm is builtin to most shells) tries to
>> apply it as a command- line switch.
>
> As I said, every script that doesn’t deal with them properly is buggy
> (sloppy programmers, hence script kiddies).
Well, I don’t consider myself a script kiddie or a sloppy coder, but I
have noticed (at least in tcsh, which is my shell of choice) that
sometimes if I’m doing an operation on a directory of files, I
occasionally run into problems with files with spaces in the names.
Maybe I’m not as rigorous as I need to be, but if one is going to have
files with spaces in the names, one does have to be more careful in
coding than if filenames are not.
> And short of magic fairy dust, there’s no way to have a ‘-’ followed by
> a letter mean two different things. So some syntactic noise is
> inevitable. Speaking just for myself, I can count the number of times
> I’ve wanted to start a filename with a ‘-’ over the last thirty years on
> the fingers of one foot 
Well, yes, I know that there’s no way to tell the difference (unless the
program in question understands “–” to mean "no more parameters are
command-line options, which some programs do). I run into it when I
occasionally do a dumb thing when creating a file - I pass the wrong
thing to a program and the switch gets interpreted as a filename instead
of a switch.
It’s not a common thing I want to do either, for that very reason. I’ve
tried escaping it with \ and with single and double quotes - none of
those options work. I usually give up trying to do it from the command-
line and launch mc to deal with it.
>> And while FAT16 doesn’t support spaces, FAT32 does - so it’s not
>> accurate to say DOS and Windows don’t support spaces in filenames,
>> because they have since at least Win95 as I recall (with long filename
>> support enabled).
>
> I quite deliberately didn’t say “DOS and Windows don’t support spaces”,
> I said “DOS and Windows didn’t” 
OIC, yes, you did. But you have to admit, that either wording could be
construed as meaning “don’t”.
(And I speak as a pedant myself when
it comes to the English language <g>)
Jim
–
Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C