Re: [PATCH] Ignore file filter
- From
Junio C Hamano <junkio@cox.net>
- Date
- May 14, 2005, 09:01 UTC
- Message-ID
- <7vy8ai2nb6.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <4285B6A8.4080309@dgreaves.com>
>>>>> "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
For a glob:
patt='?.sh'
file=1.sh case "$file" in
$patt)
echo Yeah ;;
*)
echo No ;;
esac