bug-bash
[Top][All Lists]
Advanced

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

Re: bash does not jump where it is supposed to jump


From: Jan Schampera
Subject: Re: bash does not jump where it is supposed to jump
Date: Sat, 19 Jan 2008 10:36:30 +0100
User-agent: IceDove 1.5.0.14pre (X11/20071018)

William Tambe wrote:

> The code below should only print end

> [ "test" = "test" ] && {
>     # after the false command bash should jump directly to echo end
>     # but instead run echo echo "test != test"
>     false
> } || {
>     echo "test != test"
> }
> 
> echo end

It's okay like that, it's like lists (&&, || chained commands) should
work. If it's not safe for you, just use an ''if'':


----snipsnap----
if [ "test" = "test" ]; then
  false
else
  echo "test != test"
fi

echo end
----snipsnap----

J.




reply via email to

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