Of course, a regex is overkill in the below example; the equivalent is: while (<DIRLIST>) { next unless $_ eq 'index.html'; .... }
ap ---------------------------------------------------------------------- Andrew J Perrin - Ph.D. Candidate, UC Berkeley, Dept. of Sociology Chapel Hill, North Carolina, USA - http://demog.berkeley.edu/~aperrin [EMAIL PROTECTED] - [EMAIL PROTECTED] On Thu, 15 Feb 2001, Ben Collins wrote: > On Thu, Feb 15, 2001 at 07:22:31PM -0600, William Jensen wrote: > > Greetings, > > > > I am trying to find a regular expression that will include every file > > in a directory except one named one. For example if I had a file > > called index.html and then hundreds of other .html files in the same > > directory, how can I do a reg expression to say "all the .html files" > > except index.html? Been rack'n my brain on this one for a bit of time > > and I could use some help from someone more experienced. > > Note sure in what context you are doing this, but in perl I would do: > > while (<DIRLIST>) { > /^index.html$/ and next; > .... > } > > and in shell > > for file in `ls * | egrep -v '^index.html$'`; do > .... > done > > Ben > > -- > -----------=======-=-======-=========-----------=====------------=-=------ > / Ben Collins -- ...on that fantastic voyage... -- Debian GNU/Linux \ > ` [EMAIL PROTECTED] -- [EMAIL PROTECTED] -- [EMAIL PROTECTED] ' > `---=========------=======-------------=-=-----=-===-======-------=--=---' > > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] > >