![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to delete text from line starting pattern1 up to line before pattern2? | repudi8or | Shell Programming and Scripting | 5 | 04-15-2008 06:25 PM |
| Running two commands in one line | rdns | UNIX for Dummies Questions & Answers | 2 | 11-30-2007 03:14 AM |
| Seperate commands on the same line | bobk544 | Shell Programming and Scripting | 3 | 07-28-2007 02:14 PM |
| code that reads commands from the standard i/p and executes the commands | Phrozen Smoke | High Level Programming | 4 | 01-21-2007 11:06 PM |
| Commands and Command Line Flags | Kedgeboy | Shell Programming and Scripting | 4 | 07-11-2005 07:23 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
two commands on 1 line
wuts the command that allows u to use 2 commands on one line?
|
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Quote:
you can run multiple commands on a single line by separating the commands by a semi colon. example: echo $PWD ; ls -a You can also run multiple commands on a single line via a pipe. The pipe takes the output of one command and "pipes" it as input to another command. example: ps -ef | grep ORA |
|
#3
|
||||
|
||||
|
Also, if you want to conditionally execute the second command based on the return code of the first you can use || or &&.
<command1> && <command2> will execute command2 if command1 returns a value >= 0 (ie success). <command1> && <command2> will exeucte command2 if command1 returns a value < 0 (ie failure) Cheers, Keith |
||||
| Google The UNIX and Linux Forums |