Re: regular expression?
On Thu, Feb 15, 2001 at 08:29:34PM -0500, 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
I should have been more specific. This is in regards to apache. I want
to control user access by file not directory. I don't want to name
every singe file though, so I'd like to say "everything except index.html"
gets a password.
Sorry for the confusion thought I did like the perl tip. :)
Bill
>
> --
> -----------=======-=-======-=========-----------=====------------=-=------
> / Ben Collins -- ...on that fantastic voyage... -- Debian GNU/Linux \
> ` bcollins@debian.org -- bcollins@openldap.org -- bcollins@linux.com '
> `---=========------=======-------------=-=-----=-===-======-------=--=---'
Reply to: