Re: [SLE] bash Script Using Filenames with Embedded Spaces
- From: Darryl Gregorash <raven@xxxxxxxxxxxxx>
- Date: Tue, 07 Nov 2006 11:58:05 -0600
On 2006-11-07 09:46, Randall R Schulz wrote:
OK, you've answered a lot of questions, but raised a few more. (No
offence intended, but I do think Joachim has given a better explanation
of this.)
<snip>In this instance, we are talking about filenames that clearly have
Nonetheless, my point was that if you have a character such as an
en-space (or it's fatter sibling, em-space, which is the width of a
lower-case 'm'), it can be expanded unquoted in an argument list
without the en-space causing a break in the argument as a regular space
would.
regular spaces as part of their filenames, so I don't see how speaking
of en- or em-spaces is relevant. I don't believe there is any way a
regular space could be translated to any other kind of space just as
part of any glob processing.
Absolutely not. Ls is not special in this way. The only specialI didn't say ls is special in any way; what I did say (not very well, I
treatment is the expansion of the glob pattern...
admit) is that the ls commandline syntax is "ls ... <space delimited
list of filespecs>" and thus, without any (double) quotes around the
variable name, "ls ... $i" will produce unexpected results if the value
of $i is a filespec containing spaces.
<snip>As I just found running "echo *.m3u" in that directory, on the
for i in '*.m3u'; do echo $i; ls -l $i; done
In this case, the glob expansion of *.m3u is happening upon each
unquoted reference in the body of the loop.
commandline. -That- is something I certainly did not expect -- :-)
Fortunately for you, I do not do all that much, or you might suddenlyDid someone say the bash commandline isn't interesting and fun? :-)
I think so. I do tons of BASH programming.
find your inbox full of messages starting "Help, I cannot figure out
what this thing is doing...." :-)
--
Check the headers for your unsubscription address
For additional commands send e-mail to suse-linux-e-help@xxxxxxxx
Also check the archives at http://lists.suse.com
Please read the FAQs: suse-linux-e-faq@xxxxxxxx
- Follow-Ups:
- Re: [SLE] bash Script Using Filenames with Embedded Spaces
- From: Randall R Schulz
- Re: [SLE] bash Script Using Filenames with Embedded Spaces
- References:
- [SLE] bash Script Using Filenames with Embedded Spaces
- From: Lucky Leavell
- Re: [SLE] bash Script Using Filenames with Embedded Spaces
- From: Randall R Schulz
- Re: [SLE] bash Script Using Filenames with Embedded Spaces
- From: Darryl Gregorash
- Re: [SLE] bash Script Using Filenames with Embedded Spaces
- From: Randall R Schulz
- [SLE] bash Script Using Filenames with Embedded Spaces
- Prev by Date: Re: [SLE] SPAM: A good read re Microsoft and Novell
- Next by Date: Re: [SLE] SPAM: A good read re Microsoft and Novell
- Previous by thread: Re: [SLE] bash Script Using Filenames with Embedded Spaces
- Next by thread: Re: [SLE] bash Script Using Filenames with Embedded Spaces
- Index(es):