From owner-freebsd-questions Mon Oct 20 09:50:31 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id JAA04502 for questions-outgoing; Mon, 20 Oct 1997 09:50:31 -0700 (PDT) (envelope-from owner-freebsd-questions) Received: from mailgate.greenhills.co.uk (mailgate.greenhills.co.uk [195.11.194.180]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id JAA04492 for ; Mon, 20 Oct 1997 09:50:23 -0700 (PDT) (envelope-from mak@greenhills.co.uk) Received: (qmail 5156 invoked by uid 982); 20 Oct 1997 16:47:46 -0000 Message-ID: <19971020174746.27723@webcrawler.com> Date: Mon, 20 Oct 1997 17:47:46 +0100 From: Martijn Koster To: abbott on blue Cc: questions@FreeBSD.ORG Subject: Re: Unix question. Regular expressions in commands? References: <28262143@toto.iv> <3.0.3.32.19971020101324.00a53e90@blue.pca.state.mn.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.76 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 Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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