Re: [PATCH] Ignore file filter
- From
Petr Baudis <pasky@ucw.cz>
- Date
- May 14, 2005, 14:24 UTC
- Message-ID
- <20050514142421.GG3905@pasky.ji.cz>
- In-Reply-To
- <7vy8ai2nb6.fsf@assigned-by-dhcp.cox.net>
Dear diary, on Sat, May 14, 2005 at 11:01:49AM CEST, I got a letter where Junio C Hamano <junkio@cox.net> told me that...
Show 12 quoted lines
> >>>>> "DG" == David Greaves <david@dgreaves.com> writes: > > >>> if [[ $file =~ $patt ]]; then > >> > >> I'm sorry but this is really nothing my bash-2.05.0(1)-release supports. > DG> OK > DG> I don't know how to do that. > > Is that regexp or shell glob? If regexp, expr is your friend, > like this: > > if expr "$file" : "$patt" >/dev/null; then
Oh, this looks nice. I didn't know expr can do that. :-)
Still, I'd prefer the old-fashioned globs as primary matching mechanism.
-- Petr "Pasky" Baudis Stuff: http://pasky.or.cz/ C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor