Date: Mon, 20 Oct 1997 11:23:37 -0500 From: Jonathan Lemon <jlemon@americantv.com> To: abbott on blue <jabbott@blue.pca.state.mn.us> Cc: questions@FreeBSD.ORG Subject: Re: Unix question. Regular expressions in commands? Message-ID: <19971020112337.20757@right.PCS> In-Reply-To: <3.0.3.32.19971020101324.00a53e90@blue.pca.state.mn.us>; from abbott on blue on Oct 10, 1997 at 10:13:24AM -0500 References: <28262143@toto.iv> <3.0.3.32.19971020101324.00a53e90@blue.pca.state.mn.us>
index | next in thread | previous in thread | raw e-mail
On Oct 10, 1997 at 10:13:24AM -0500, abbott on blue wrote:
> I guess this is kind of a newbie unix question. I have just learned about
> regular expressions within perl and so am trying to use them everyplace. :-)
>
> >From a command line what I would like to do is....
> # mv *.[dump asc dat txt clean] tablecreation
>
> but this does not work. I end up having to...
> # mv *.dump tablecreation
> # mv *.asc tablecreation
> # mv *.dat tablecreation
> # mv *.txt tablecreation
> # mv *.clean tablecreation
>
> Is there anyway to do regular expression matching within commands?
Depends on the shell you use. With tcsh, you can do the following:
mv *.{dump,asc,dat,txt,clean} tablecreation
I don't think this is possible with sh; other shells may provide the
same functionality but with different syntax.
--
Jonathan
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19971020112337.20757>
