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

Re: for i in *



Hejsan!

> Okay, so what you're saying is that you prefer efficient parsing of a
> script, while I prefer the aestheticy (sp?) provided by spaces. 
> Obviously, there's a trade-off between the two, and we emphasize
> different aspects.  So there are some points to the arguement that
> Spaces In Filenames(tm) is a Bad Thing(tm), but my suggestion of
> improved readability is also valid and therefore one could argue that
> Spaces In Filenames(tm) is a Good Thing(tm).
> 
> Now, how is that for a compromise, eh?  Damn, am I good.  Peace
> brothers, peace!

So how about these little_small_underscores in filnames. In my opinion
they come closest to a plain space, and you can get really used to them,
e.g. after a while you see a "_" as " ". And you don't have the problem,
that you use a character, which is normaly or by accident interpreted by
the shell as the end of a file name... It just avoids problems like

mfluch@seneca:~> mkdir test
mfluch@seneca:~> cd test/
mfluch@seneca:~/test> mkdir 1
mfluch@seneca:~/test> touch "1/2 3" 3
mfluch@seneca:~/test> find  
.
./1
./1/2 3
./3
mfluch@seneca:~/test> find 1 -type f
1/2 3
mfluch@seneca:~/test> find 1 -type f | xargs rm 
rm: cannot remove `1/2': No such file or directory
mfluch@seneca:~/test> find 
.
./1
./1/2 3
mfluch@seneca:~/test> 

Huh, where has the file ./3 gone? Sure, there are posibilities to work
around that (-print0), but it is just one example of certain side effects
you have too consider _if_ you use spaces in filenames. It's just
(IMHO) more secure not to use them...

Cheers,
Martin



Reply to: