[HPADM] SUMMARY: Listing explicit directories using regular expressions

From: Grimes, Niall (Niall.Grimes@intecbilling.com)
Date: Mon Aug 22 2005 - 06:48:20 EDT


Thanks to all who replied.

David Lodge, David Lee Totsch and Bill Hassell hit the nail on the head -
'ls' doesn't understand extended regular expressions but uses globbing to
pattern match. So the following command line does the trick for me:

        ls /path/to/@(first|second)/directory

Of course, I should have gone to 'man sh-posix' first.

Bill also noted that:

        the shell only pattern matches with ordinary regular expressions and
ls/ll doesn't know anything at all about regular expressions.
        What ls processes is exactly what the shell passes. To see this, put
echo in front, something like this:
        echo ls /etc/i*

I'll keep that tip handy!

Thanks also to the following:

David R Antoch
Eef Hartman
Mark D Schupsky
Jeff Lightner
Shyam Hazari
Blazej Antczak
Vidal Cazarez
Ruby Domalanta
Brett Geer
C Beerse

> ______________________________________________
> From: Grimes, Niall
> Sent: 19 August 2005 14:47
> To: hpux-admin@DutchWorks.nl
> Subject: Listing explicit directories using regular expressions
>
> Hi admins,
>
> Is it possible to list the contents of multiple explicit directories?
> For example, with the following directory structure:
>
> /path/to/first/directory
> /path/to/second/directory
> /path/to/third/directory
> /path/to/fourth/directory
> /path/to/fifth/directory
>
> ...is it possible to list the contents of the ../first/.. and
> ../second/.. directories with a single 'ls' command line?
>
> I've tried the following but it doesn't work:
>
> # ls /path/to/[first|second]/directory
>
>
> Thanks.
>
>
This e-mail and any attachments are confidential and may also be legally
privileged and/or copyright material of Intec Telecom Systems PLC (or its
affiliated companies). If you are not an intended or authorised recipient
of this e-mail or have received it in error, please delete it immediately
and notify the sender by e-mail. In such a case, reading, reproducing,
printing or further dissemination of this e-mail or its contents is strictly
prohibited and may be unlawful.
Intec Telecom Systems PLC does not represent or warrant that an attachment
hereto is free from computer viruses or other defects. The opinions
expressed in this e-mail and any attachments may be those of the author and
are not necessarily those of Intec Telecom Systems PLC.

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:49 EDT