On Wed, 2011-05-11 at 23:18 +0200, Pol Vangheluwe wrote:

> The bash manual tells me that the structure "command1 && command2"
> executes command2
> if and only if command1 returns the exit status of zero.
> But here, there is only one command (cat), so I really don't
> understand why "&&" is needed.

Correct on the syntax, but you're wrong that only one command is
present. From the sudo example:

cat > /etc/pam.d/sudo << "EOF" &&
# Begin /etc/pam.d/sudo
...content removed...
# End /etc/pam.d/sudo
EOF
chmod 644 /etc/pam.d/sudo


There are two commands - the 'cat', and the subsequent 'chmod'. The
xinetd examples are similar.


> BTW: can you explain why the 'xinetd.conf' script has no "&&" but the
> 'xinetd.d/<server>' scripts have it on the xinetd-2.3.14 page?
> The first runs well, the other fail...

Because the xinetd.conf script is a single command, just one 'cat'
statement. But the xinetd.d case consists of twenty or so commands, all
separated by &&.

Simon.

Attachment: signature.asc
Description: This is a digitally signed message part

-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to