[dundee] BashPitfalls

Sean McRobbie lug at seany.us
Thu Feb 17 22:54:56 UTC 2011


I've always figured spaces are a non issue:

[sean at home ~]$ mkdir -p "test/File or folder with spaces"
[sean at home ~]$ mkdir -p test/Another\ File\ or\ folder\ with\ spaces
[sean at home ~]$ ls -l test
total 16
drwxrwxr-x 2 sean sean 4096 Feb 17 22:48 Another File or folder with spaces
drwxrwxr-x 2 sean sean 4096 Feb 17 22:48 File or folder with spaces

Tab-complete is a godsend, too.

Regards,
Sean McRobbie

----- Original Message -----
From: "Martin Habets" <errandir_news at mph.eclipse.co.uk>
To: "Tayside Linux User Group" <dundee at lists.lug.org.uk>
Sent: Thursday, 17 February, 2011 10:41:32 PM
Subject: Re: [dundee] BashPitfalls

On Wed, Feb 09, 2011 at 10:37:50PM +0100, Axel wrote:
> In circumstance you have to port your program to another
> operation system such as Windows, you have to avoid this or is will
> be crashing. There are directories like "Documents and Settings",
> which contain spaces.

I must say, that one still puzzles me. Took me quite a while to figure out
how to cd into that directory. Tried "cd Document~1" and stuff like that
for a while. Frustrating...

Nowadays I usually avoid it, sftp my work between C:\TEMP and the Linux
machine.
Would windows allow me to rename that directory to Documents_and_Settings,
or will it insist on the spaces?

Martin

> I take the view, both ways are bad. Spaces in file names make
> working with the command line
> much complicated and programs which ignore spaces are not reliable
> in their behaviour.
> 
> Quoting James Le Cuirot <chewi at aura-online.co.uk>:
> 
> >On Wed, 9 Feb 2011 16:25:54 +0000
> >Andrew Clayton <andrew at digital-domain.net> wrote:
> >
> >>> These are some very negative attitudes. I sometimes use spaces for
> >>> stuff in my home folder. I certainly use them for my music files.
> >>> I
> >>
> >>Why? Assuming your music is properly tagged (why wouldn't it be?) then
> >>spaces serve no purpose.
> >
> >My music is tagged properly and I must admit, I don't have a good a
> >answer for that, but I feel my point still stands. Good coders should
> >always take them into account.
> >
> >James

_______________________________________________
dundee GNU/Linux Users Group mailing list
dundee at lists.lug.org.uk  http://dundeelug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/dundee
Chat on IRC, #tlug on irc.lug.org.uk



More information about the dundee mailing list