From: Ben Finney on
Barry Margolin <barmar(a)alum.mit.edu> writes:

> In article <873a5cbeqa.fsf(a)benfinney.id.au>,
> Ben Finney <bignose+hates-spam(a)benfinney.id.au> wrote:
> > Rather, the space is a normal character in filenames; those who
> > avoid it are actively limiting themselves in comparison to those who
> > use it freely, and that limitation should be recognised.
>
> My point was that in general, GUI users are far more likely to use
> special characters in filenames than CLI users. There may be some CLI
> users who do it as well, but I expect they're a small minority. Since
> the OP didn't realize that filenames with whitespace are an issue, he's
> probably never had to write scripts that deal with files created by GUI
> users, and his CLI users tend towards the traditional naming styles.

My point was only that there is no necessary “CLI user / GUI user”
divide on avoiding the use of space or other natural-language
characters; it's a false generalisation and, in my opinion, a foolish
one.

> Probably he's only written scripts to work with his own files, rather
> than trying to write them more generally.

Yes, that seems likely to me too.

--
\ “I have a map of the United States; it's actual size. It says |
`\ '1 mile equals 1 mile'. Last summer, I folded it.” —Steven |
_o__) Wright |
Ben Finney
From: Sivaram Neelakantan on
Barry Margolin <barmar(a)alum.mit.edu> writes:


[snipped 45 lines]

> Since the OP didn't realize that filenames with whitespace are an
> issue, he's probably never had to write scripts that deal with files
> created by GUI users, and his CLI users tend towards the traditional
> naming styles. Probably he's only written scripts to work with his
> own files, rather than trying to write them more generally.

That's right, I write scripts mostly for myself. And as mentioned, I
pretty much expect the people using my scripts to NOT use spaces in
the file names. :-)


sivaram
--
From: Ben Finney on
Sivaram Neelakantan <nsivaram.net(a)gmail.com> writes:

> That's right, I write scripts mostly for myself. And as mentioned, I
> pretty much expect the people using my scripts to NOT use spaces in
> the file names. :-)

The disconnect in that is your scripts, even if you are the only one who
*uses* them directly, will inevitably be called upon to process
filenames generated by others. That's assuming, of course that you don't
suffer from OCD to the extent of checking the name of every single file
as it makes its way anywhere into your filesystem.

The point being that it's far simpler, and never harmful, to make one's
scripts more robust in the face of easily-foreseen cases, by *always*
double-quoting any parameter expansion that might be a filename.

--
\ “Our products just aren't engineered for security.” —Brian |
`\ Valentine, senior vice-president of Microsoft Windows |
_o__) development, 2002 |
Ben Finney
From: Kevin Collins on
On 2009-10-22, Barry Margolin <barmar(a)alum.mit.edu> wrote:
> In article <873a5cbeqa.fsf(a)benfinney.id.au>,
> Ben Finney <bignose+hates-spam(a)benfinney.id.au> wrote:
>
>> Barry Margolin <barmar(a)alum.mit.edu> writes:
>>
>> > In article <87pr8hb3pu.fsf(a)benfinney.id.au>,
>> > Ben Finney <bignose+hates-spam(a)benfinney.id.au> wrote:
>> >
>> > > Barry Margolin <barmar(a)alum.mit.edu> writes:
>> > >
>> > > > I guess you don't work with people who mostly work in GUIs rather
>> > > > than CLIs. It's very common for them to use phrases when naming
>> > > > files. E.g. "September Expenses" rather than "september-expenses".
>> > >
>> > > Heck, I do it quite often, and I've been a committed CLI user for
>> > > most of my life at the computer. The space is a perfectly valid
>> > > character in filenames, it can often make for a more reasonable
>> > > filename, and tools that use filenames need to handle all valid
>> > > characters; that's why the shell has easy quoting for parameters.
>> >
>> > I think most CLI users don't use these types of names because it
>> > requires extra typing to quote them.
>> >
>> > touch foobar
>> >
>> > vs.
>> >
>> > touch "foo bar"
>>
>> That's fine, and I also do that: deliberately avoiding special
>> characters in file names if those names are more an interface between
>> programs rather than an interface to the user.
>>
>> But it's false to then claim that using the space character in a
>> filename somehow makes one less worthy of the CLI, or making some kind
>> of mistake that “true CLI users” are wise enough to avoid. (You didn't
>> quite do this, but I detect it often, and this thread is no exception.)
>>
>> Rather, the space is a normal character in filenames; those who avoid it
>> are actively limiting themselves in comparison to those who use it
>> freely, and that limitation should be recognised.
>
> My point was that in general, GUI users are far more likely to use
> special characters in filenames than CLI users. There may be some CLI
> users who do it as well, but I expect they're a small minority. Since
> the OP didn't realize that filenames with whitespace are an issue, he's
> probably never had to write scripts that deal with files created by GUI
> users, and his CLI users tend towards the traditional naming styles.
> Probably he's only written scripts to work with his own files, rather
> than trying to write them more generally.

Actually, no. I have quite a depth of scripting experience and generally write
intelligent, well commented, flexible and efficient scripts (in various
languages).

However, I have always worked on Unix (and Linux) systems where it is a rare
case to encounter a file or directory with a space in the name, and "corrected"
when found. Users creating such file names are heavily "discouraged" from doing
so...

But that is just the 8 or 10 places I have worked over the last 15+ years... :)

Thanks,

Kevin
From: Kevin Collins on
On 2009-10-23, Kevin Collins <spamtotrash(a)toomuchfiction.com> wrote:
> On 2009-10-22, Barry Margolin <barmar(a)alum.mit.edu> wrote:
>> In article <873a5cbeqa.fsf(a)benfinney.id.au>,
>> Ben Finney <bignose+hates-spam(a)benfinney.id.au> wrote:
>>
>>> Barry Margolin <barmar(a)alum.mit.edu> writes:
>>>
>>> > In article <87pr8hb3pu.fsf(a)benfinney.id.au>,
>>> > Ben Finney <bignose+hates-spam(a)benfinney.id.au> wrote:
>>> >
>>> > > Barry Margolin <barmar(a)alum.mit.edu> writes:
>>> > >
>>> > > > I guess you don't work with people who mostly work in GUIs rather
>>> > > > than CLIs. It's very common for them to use phrases when naming
>>> > > > files. E.g. "September Expenses" rather than "september-expenses".
>>> > >
>>> > > Heck, I do it quite often, and I've been a committed CLI user for
>>> > > most of my life at the computer. The space is a perfectly valid
>>> > > character in filenames, it can often make for a more reasonable
>>> > > filename, and tools that use filenames need to handle all valid
>>> > > characters; that's why the shell has easy quoting for parameters.
>>> >
>>> > I think most CLI users don't use these types of names because it
>>> > requires extra typing to quote them.
>>> >
>>> > touch foobar
>>> >
>>> > vs.
>>> >
>>> > touch "foo bar"
>>>
>>> That's fine, and I also do that: deliberately avoiding special
>>> characters in file names if those names are more an interface between
>>> programs rather than an interface to the user.
>>>
>>> But it's false to then claim that using the space character in a
>>> filename somehow makes one less worthy of the CLI, or making some kind
>>> of mistake that “true CLI users” are wise enough to avoid. (You didn't
>>> quite do this, but I detect it often, and this thread is no exception.)
>>>
>>> Rather, the space is a normal character in filenames; those who avoid it
>>> are actively limiting themselves in comparison to those who use it
>>> freely, and that limitation should be recognised.
>>
>> My point was that in general, GUI users are far more likely to use
>> special characters in filenames than CLI users. There may be some CLI
>> users who do it as well, but I expect they're a small minority. Since
>> the OP didn't realize that filenames with whitespace are an issue, he's
>> probably never had to write scripts that deal with files created by GUI
>> users, and his CLI users tend towards the traditional naming styles.
>> Probably he's only written scripts to work with his own files, rather
>> than trying to write them more generally.
>
> Actually, no. I have quite a depth of scripting experience and generally write
> intelligent, well commented, flexible and efficient scripts (in various
> languages).
>
> However, I have always worked on Unix (and Linux) systems where it is a rare
> case to encounter a file or directory with a space in the name, and "corrected"
> when found. Users creating such file names are heavily "discouraged" from doing
> so...
>
> But that is just the 8 or 10 places I have worked over the last 15+ years... :)

Sorry... I thought you meant me, but on re-reading I think you may have been
meaning the OP.

Kevin