bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exit application with two function calls


From: Linda Walsh
Subject: Re: Exit application with two function calls
Date: Mon, 28 Jan 2008 04:12:04 -0800
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

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 <bash@tlinx.org> 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

[Prev in Thread] Current Thread [Next in Thread]