Re: bash, grep, and regular expressions

From: Freddy Freeloader (fredddy_at_cableone.net)
Date: 02/18/05

  • Next message: Freddy Freeloader: "Re: bash, grep, and regular expressions"
    Date: Thu, 17 Feb 2005 20:37:11 -0800
    To: debian list <debian-user@lists.debian.org>
    
    

    Glenn English wrote:
    > On Thu, 2005-02-17 at 16:08 -0800, Freddy Freeloader wrote:
    >
    >
    >>What I've been attempting to do with grep
    >>and regular expressions is list only non-hidden directories and/or
    >>files. I am unable to come up with an expression that will elimate
    >>hidden files and return non-hidden files at the same time.
    >>
    >>ls -al | grep -v ' \.\<[a-zA-Z0-9].*\>' # returns everything
    >>
    >>ls | grep -e '\<[^.][[:alnum:]]' # returns everything
    >>
    >>ls | grep -e '\<[.][[:alnum:]]' # returns an empty set
    >>
    >
    >
    > ls -al | grep -v ' \.' seems to work here???
    >

    Excellent. That fixes part of the problem. However, it only returns
    directories as files almost always have a .ext on the end of the file
    name and this expression filters out all lines with .'s in them.

    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Freddy Freeloader: "Re: bash, grep, and regular expressions"