Need help with sed or awk and regular expressions
Michael Ault
mikerault at yahoo.com
Sat Jul 2 15:41:25 UTC 2005
Excellent, so to pass in a list of file names to be
converted you would pipe the results of the ls command
through this? We have a list of about 100 files that
need to be renamed.
Mike
--- inode0 <inode0 at gmail.com> wrote:
> On 7/1/05, inode0 <inode0 at gmail.com> wrote:
> > $ echo $FOO
> > 44.MR3M01J.AF_TBL_COL_1.2005-06-30.DAT
> > $ echo ${FOO//+(44.MR3M01J.|_[12]*[0-9-])}
> > AF_TBL_COL.DAT
>
> Ack! That last hypen is leftover harmless cruft. All
> one needs is
>
> $ echo ${FOO//+(44.MR3M01J.|_[12]*[0-9])}
> AF_TBL_COL.DAT
>
> My first iteration was
>
> $ echo ${FOO//+(44.MR3M01J.|_[12].*([0-9-]))}
> AF_TBL_COL.DAT
>
> which may be a more clear expression to match the
> second part of the
> string to delete.
> Regular expressions give just about everyone a
> headache. :)
>
> John
>
> _______________________________________________
> Redhat-install-list mailing list
> Redhat-install-list at redhat.com
>
https://www.redhat.com/mailman/listinfo/redhat-install-list
> To Unsubscribe Go To ABOVE URL or send a message to:
> redhat-install-list-request at redhat.com
> Subject: unsubscribe
>
Michael R. Ault
Senior Consultant
Burleson Oracle Consulting
770-754-9057
www.ault.cc
www.remote-dba.com
More information about the Redhat-install-list
mailing list