Wildcard

Wildcard

Post by Thomas Mitchel » Thu, 12 Dec 2002 22:22:45



Hi,

I'm trying to use ls with a negative form of wildcard, e.i. I want to list
all files that so not have a certain ending. Is there a way of doing this?

Thomas Mitchell

 
 
 

Wildcard

Post by Samuel Mo?u » Thu, 12 Dec 2002 22:41:07


On 11 Dec 2002 13:22:45 GMT


> Hi,

> I'm trying to use ls with a negative form of wildcard, e.i. I want to list
> all files that so not have a certain ending. Is there a way of doing this?

> Thomas Mitchell

Are you looking for something like
$ ls *[^html]
or
$ ls | grep '*[^html]'
,or something more complex?

--
         "Los videojuegos No afectan a los ni?os. Si fuera as, y el Comecocos nos
         hubiera afectado a nosotros cuando eramos ni?os, la gente de nuestra
         generacin estara deambulando por lugares oscuros, comiendo pldoras
         mgicas y escuchando ritmos electrnicos repetitivos."

Kristian Wilson, Nintendo, Inc., 1989.

 
 
 

Wildcard

Post by Stephane Chazela » Thu, 12 Dec 2002 23:37:47


In article

[...]

Quote:> $ ls *[^html]

In a Bourne shell or with some kshs, this will return the list
of filenames that end with either ^, h, t, m or l.

With bash, zsh and some other shells, this will return the list
of filenames that end with neither of the h, t, m, or l
characters.

(excluding dot files)

Quote:> or
> $ ls | grep '*[^html]'

Will return the list of filenames (or only some lines of them)
that contain '*' followed by any character different from h, t,
m or l.

This question was asked few days ago (and many times before) in
comp.unix.shell.

--
Stphane

 
 
 

Wildcard

Post by Erik Max Franci » Fri, 13 Dec 2002 06:12:52



> I'm trying to use ls with a negative form of wildcard, e.i. I want to
> list
> all files that so not have a certain ending. Is there a way of doing
> this?

As far as I know, there's no way to do this with standard globs, though
you could get the same effect in conjunction with, say, grep -v.

zsh and other shells have extended glob options when enabled which allow
you to do things like

        ls ^*.html

or

        ls *~*.html

--

 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ Substance is one of the greatest of our illusions.
\__/ Sir Arthur Eddington
    The laws list / http://www.alcyone.com/max/physics/laws/
 Laws, rules, principles, effects, paradoxes, etc. in physics.

 
 
 

1. Wildcard DNS, Wildcard ServerName, Rewrite/Problems.

Hello all,

        I'm having some trouble with setting up a virtual system that points
all sublevel domains to a single file which does all the work. On a static
name, such as www.domain.com, the rules work, and the page is rewritten
properly, and the code works fine. When wildcarded, the server goes into an
endless loop of 302 redirects. Example:

DNS:

*       IN      A       128.0.0.1

<VirtualHost 128.0.0.1>
DocumentRoot /www/
ServerName *.domain.com
RewriteEngine On
RewriteOptions inherit
</VirtualHost>

Rules (inherited from primary host):

RewriteCond %{REMOTE_ADDR} .*
RewriteRule ^/robots.txt /www/robots.txt [L]

RewriteCond %{REMOTE_ADDR} .*
RewriteRule ^/(.*) http://%{HTTP_HOST}/engine/index.html [L]

Can anyone shed some light on how to fix this? I need to have the response
sent back as a 200, which is what it does when using a fixed name such as
www.domain.com.

Any help would be appreciated.

Thanks,

Mike

2. Where are the 3des/esp modules for Sol8?

3. Wildcard in PATH ?

4. external laptop display (2 monitors 1 card)

5. Rewrite with wildcards

6. Future Domain SCSI : BIOS ???

7. deflector map wildcards?

8. 3c509 and BSDI3

9. DNS/URL "wildcards"

10. Renaming Unix Files with Wildcard

11. .rhosts - how to enable wildcard remsh access

12. excluding files from tar creation using wildcards

13. Wildcard use with LS