bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shouldn't /+(??) capture 2 letter files only?


From: Rene Herman
Subject: Re: shouldn't /+(??) capture 2 letter files only?
Date: Sat, 15 Dec 2012 00:25:58 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 12/14/2012 11:29 PM, gregrwm wrote:

well what i actually wanted was to conjure an expression that selected
a small few files, and then invert the expression, in particular i
wanted to isolate all 2 letter names plus a few other names, and then
invert, so that the aforementioned were not in the selection.  perhaps
that's just a tad beyond what a bash expression can do (without
writing a loop)?

(shopt -s extglob)

echo !(??|foo|bar)

or if you want to loop over those files, "for FILE in !(??|foo|bar); do echo "$FILE"; done" and so on.

Rene.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]