Dang---you're right of course.  Didn't test the error case...too used to perl.

That's why I drag myself through shell scripts trying to do things I
might be tempted to do in perl...*sigh*


probably have to resort to a else block, running "Error", then
returning the status, i.e.:
---
else
        Error "invalid directory: "\$1\""
        return $?
fi
---


Andreas Schwab wrote:
Linda Walsh <[EMAIL PROTECTED]> writes:

Check_file ()
{
    if [[ -d "$1" ]]; then echo "$1"                               # *4
    else return Error "invalid directory: \"$1\""; fi

"return" expects a number, not the string "Error" as the first argument
and does not take any further arguments.

Andreas.



Reply via email to