Thread (5 messages) flat view 5 messages, 3 authors, 2016-06-15

Re: [PATCH] Ignore file filter

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:41:57

quoted
quoted
quoted
quoted
"DG" == David Greaves [off-list ref] writes:
quoted
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help