Skip to contentSkip to conversation

&& - Help

DISCUSSION Paul Kraus 3 participants 3 messages Sep 30, 2002

lore
Share & tools
lore

Paul Kraus

author
#0 lore raw

What does && represent?

Here is the command that I saw it in.
watch -n 1 "/hylafax/etc/errorstats.sh /hylafax/etc/xferfaxlog && faxstat -asl && echo && tail /var/log/messages"

Also why is the echo necessary.

Cross Posted due to relevancy.

Paul Kraus
Network Administrator
PEL Supply Company
216.267.5775 Voice
216-267-6176 Fax
www.pelsupply.com

____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe [email protected] < /dev/null
*To learn about commercial HylaFAX(tm) support, mail [email protected].*

#1 lore raw

&& means to only execute the second/third/etc. command if the previous one completed succesfully. the echo is probably just toadd a blank line to make the output of this easier to read.

Quoted 18 lines · Paul Kraus

What does && represent?

Here is the command that I saw it in.
watch -n 1 "/hylafax/etc/errorstats.sh /hylafax/etc/xferfaxlog && faxstat -asl && echo && tail /var/log/messages"

Also why is the echo necessary.

Cross Posted due to relevancy.

Paul Kraus
Network Administrator
PEL Supply Company
216.267.5775 Voice
216-267-6176 Fax
www.pelsupply.com

Quoted 5 lines

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

#2 lore raw
Quoted 4 lines · Brian Jackson

&& means to only execute the second/third/etc. command if the previous one completed succesfully.
the echo is probably just toadd a blank line to make the output of this easier to read.

Maybe a nice add-on: the || does the oppesite thing; if the previous command fails, execute the next.

Example: ping -c1 non.existent.host || reinitialize_internet-connection.sh

The script is only executed when ping fails.

Quoted 11 lines
Quoted 9 lines · Paul Kraus

What does && represent?

Here is the command that I saw it in.
watch -n 1 "/hylafax/etc/errorstats.sh /hylafax/etc/xferfaxlog && faxstat -asl && echo && tail /var/log/messages"

Also why is the echo necessary.

Cross Posted due to relevancy.

HTH

--
Jos Lemmerling on Debian GNU/Linux jos(@)lemmerling(.net)

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs