regex w/ sed and bash expression
David S. Jackson
dsj at sylvester.dsj.net
Thu Sep 27 07:30:35 PDT 2001
On Thu, Sep 27, 2001 at 12:49:11AM -0400 parv <parv_ at yahoo.com> wrote:
> this was, on the fateful occasion around Sep 27 00:21 -0400,
> sent by David S. Jackson
> > Hi,
> > I'm trying to make a variable expand to include a list of
> > filenames with braces and parens as part of the filename. (The
> > files are mp3s with brackets and parens, etc, in the filenames
> > themselves.) I just want the resulting expansion to insert an
> > escape character infront of spaces and special characters so the
> > shell can find them.
> > Example: don mclean - american pie (uncut version).mp3
> > and [John Wayne]-[Pledge_of_Allegiance].mp3
> would you care for a perl program which changes file names
> to character set of [a-zA-z_-.], optionally use only lower
> case ascii characters?
> or at least, it could you give some idea ... albeit in perl.
Well, part of my overall solution is using id3ren and some id3lib
stuff, which is coming from the shell. That's where the special
characters are coming from. I actually want the special
characters in the file names. So, taking them out is not what
I'm after. I don't really want to be tied to only lowercase
characters, either. I only used 'don mclean ...' as an example
of a weird filename that I might or might not run into.
So, thanks anyway, but no.
The only reason I'm not relying on perl here is that I've using a
lot of external programs to do some work, and I didn't want to
clutter up a perl program with 'use Shell' or system() or
$x=`command` type stuff. At this point it's just easier to use
However, when I get the solution all worked out in the shell, I
would like to send *that* your way and see if you could do it in
perl any better, or if you get any ideas for it.
So, let me rephrase: thanks anyway, but not right now.
How does that sound?
David S. Jackson dsj at dsj.net
Romeo wasn't bilked in a day.
-- Walt Kelly, "Ten Ever-Lovin' Blue-Eyed Years With Pogo"
More information about the KPLUG-List