help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Matching file pattern excluding some exceptions


From: Clark WANG
Subject: Re: [Help-bash] Matching file pattern excluding some exceptions
Date: Mon, 6 Aug 2012 09:41:53 +0800

On Mon, Aug 6, 2012 at 5:52 AM, Peng Yu <address@hidden> wrote:
Hi,

Suppose that I want match all *.cpp except main*.cpp files. Instead of
using other utilities like find or grep, is there a way to use native
bash features by extend the following code to do so?

shopt -s extglob
echo !(main*).cpp

shopt -s nullglob
set -- *.cpp

--
Regards,
Peng



reply via email to

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