home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] acceptable bourne shell function names

On 30/06/09 Bart Trojanowski said:

> Yeah, it can get tricky.  What is it that you want to accomplish?

It's a function to check a bunch of directories in my current directory for
changes with respect to Git. It's something to use to interwork with
ClearCase.

git_dirstatus()
{
    if which git 1>/dev/null 2>&1
    then
        for dir in *
        do
            if [ -d $dir/.git ]; then
                echo "Checking $dir"
                (cd $dir && git status)
                echo
            fi
        done
    else
        echo "No git found in PATH!" 1>&2
    fi
}

Using a shell function is ok.

Mike
-- 
Michael P. Soulier <msoulier [ at ] digitaltorque [ dot ] ca>
"Any intelligent fool can make things bigger and more complex... It takes a
touch of genius - and a lot of courage to move in the opposite direction."
--Albert Einstein

Attachment: signature.asc
Description: Digital signature