On Sun, Jan 10, 2010 at 10:47 PM, William Stein <wst...@gmail.com> wrote:
> Is the following possible with sh?   Instead of
>
>  <do something>
> if [ $? -ne 0 ]; then
>    echo "Foo bar argh"
>    exit 1
> fi
>
> we make a function so that we can just write
>
> <do something>
> sage-err "Foo bar argh".
> (causes script to exit).
>
> We can ensure that sage-err is defined before spkg-install is run.

sage_err ()
{
    if [ $? -ne 0 ]; then
        echo "$@"
        exit 1
    fi
}

Gonzalo
-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to