Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Oct 1997 17:47:46 +0100
From:      Martijn Koster <mak@webcrawler.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:  <19971020174746.27723@webcrawler.com>
In-Reply-To: <3.0.3.32.19971020101324.00a53e90@blue.pca.state.mn.us>; from abbott on blue on Mon, Oct 20, 1997 at 10:13:24AM -0500
References:  <28262143@toto.iv> <3.0.3.32.19971020101324.00a53e90@blue.pca.state.mn.us>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Oct 20, 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. :-)

In unix shells, you use shell patterns, which differ from Perl regular
expressions. Specifically:

     *    Matches any string, including the null string.

     ?    Matches any single character.


> >From a command line what I would like to do is....
> # mv *.[dump asc dat txt clean] tablecreation

That isn't even a Perl regular expression! 

Depending on your shell, you can do that almost like you wrote.
E.g. in bash, it'd be:

  mv *.{dump,asc,dat,txt,clean} tablecreation

-- Martijn Koster, m.koster@pobox.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19971020174746.27723>