Re: [SLE] bash Script Using Filenames with Embedded Spaces
- From: Randall R Schulz <rschulz@xxxxxxxxx>
- Date: Tue, 7 Nov 2006 10:32:44 -0800
On Tuesday 07 November 2006 09:58, Darryl Gregorash wrote:
On 2006-11-07 09:46, Randall R Schulz wrote:
...
<snip>
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.
In this instance, we are talking about filenames that clearly have
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.
Non-ASCII space characters are the only hypothesis that explains this:
On Monday 06 November 2006 21:11, Lucky Leavell wrote:
for i in *.mp3
do
echo $i
mp32ogg $i
done
whch works fine if the only craziness is embedded spaces in the file
name; it failed when there were parentheses but, since that is rare
in my situation, I can live with it. (Of course, if the single quoted
$i would work there ... I'm off to try it!)
If that "works fine" with "embedded spaces," then those spaces must not
be ASCII spaces (040 / 0x20) but instead something like an en- or
em-space.
Furthermore, of all the contexts in which non-ASCII spaces might show
up, coming from a media source such as a CD or music download seems
more plausible than someone typing them at a terminal or even a GUI
application (I had to open an HTML editor, enter the HTML entity names,
switch to the WYSIWYG mode and copy the characters to get them, since I
don't know all the extended compose codes for inputting them via the
keyboard).
...
Did someone say the bash commandline isn't interesting and fun? :-)
I think so. I do tons of BASH programming.
Fortunately for you, I do not do all that much, or you might suddenly
find your inbox full of messages starting "Help, I cannot figure out
what this thing is doing...." :-)
I'm happy to answer questions, but please, post them here.
Randall Schulz
--
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
- 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
- [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] [owner] List migrations
- 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):