If I generate a "Package Download Script" in Snyaptic can it be rn from a terminal window instead of Synaptic?

Nils Kassube kassube at gmx.net
Mon Oct 22 15:05:05 UTC 2012


Avi Greenbury wrote:
> Bash allows you to have these evaluations in arbitrary places,
> without needing to have a thing to do in a loop, which is where that
> sort of construct comes from. But it must be in a single statement,
> so without any (non-escaped) newlines.

It even works with non-escaped newlines. Try for yourself: A script like 
this

false &&
echo hello

doesn't output anything because the shell reads it as a single line. 
With the "&&" at the end of the line the command is not complete. It 
needs 2 commands and therefore the shell reads the rest of the command 
from the next line, i.e. the command sequence above is actually the same 
as this:

false && echo hello

As the command "false" is equal to a failed command, the second command 
(echo hello) is not executed, even if you write it in two lines.

Considering the remark above, I think I should add to my previous mail 
that the example script of the OP with a "&&" at the end of _every_ line 
would not run at all but output an error message instead.


Nils




More information about the ubuntu-users mailing list