[HPADM] SUMMARY: Listing explicit directories using regular expressions

From: Grimes, Niall (Niall.Grimes_at_intecbilling.com)
Date: 08/22/05

  • Next message: Rajdeep Sengupta: "[HPADM] Information on unix process"
    To: hpux-admin@DutchWorks.nl
    Date: Mon, 22 Aug 2005 20:48:20 +1000
    
    

    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)
    

  • Next message: Rajdeep Sengupta: "[HPADM] Information on unix process"

    Relevant Pages

    • Re: [opensuse] regexp -- defference between < and  ?
      ... On Tuesday 29 April 2008 17:58, David C. Rankin wrote: ... With regular expressions, what is the difference between \< and \b? ...
      (SuSE)
    • Re: Replacing span tags
      ... > Hi David, ... > Confused as to why this needs to be done, whats wrong with span tags? ... > Read up on searching with regular expressions, ...
      (microsoft.public.inetserver.asp.general)
    • Re: 4x4s greener than you think.
      ... drooling bigotted fucktard, then, David? ... regular expressions are one's friend. ... Heheheh, I hadn't nticed that. ...
      (uk.transport)
    • Re: text formatting using eregi_replace
      ... > David wrote: ... >> When you run a query for the system uptime the result is displayed like ... > they have a special meaning in regular expressions. ...
      (comp.lang.php)