Re: a command "spool", ie queueing commands?

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

 



urgrue wrote:

> > You could try something like:
> > 
> >  $ command1 && command2 && command3
> 
> Better would be command1 ; command2 ; command3, because then it won't  
> depend on the previous command coming out true.

Well, whether or not it's better depends upon whether you want to
conditionalise execution of one command upon success of the previous
command.

I find it far more common for scripts to use ";" when they really
should have used "&&" than the converse. A particularly common case
is "cd foo ; dosomething"; this should almost always be using "&&".

-- 
Glynn Clements <glynn@xxxxxxxxxxxxxxxxxx>
-
: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Newbie]     [Audio]     [Hams]     [Kernel Newbies]     [Util Linux NG]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Device Drivers]     [Samba]     [Video 4 Linux]     [Git]     [Fedora Users]

  Powered by Linux