On Tuesday 14 November 2006 08:12, Anders Johansson wrote:
> On Tuesday 14 November 2006 16:53, TheOldWiseKing wrote:
> > Hi,
> >
> > It sure works, and I tried it myself. the pipe operator | takes the
> > output of the certain command and Input it to the other command.
> >
> > When saying ls > file1.txt, this will create a list of folders
> > inside the file1.txt
> > cat file1.txt will list the contents of file1.txt and take the
> > output to file2.txt
>
> It might work and it might not, but either way it is an improper use
> of the pipe. When you want to say "first run command1 then command 2"
> you should use
>
> command1 && command2

Just to be clear (and I know you know this, Anders, but others may not), 
the semicolon is unconditional sequencing regardless of how the first 
command exits or terminates, the second command is executed. The 
double-ampersand make the execution of the second command contingent 
upon normal termination and a successful exit status (0) from the first 
command.


> Anders


Randall Schulz
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to