![]() |
|
|
|
|
|||||||
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| combination of two commands | nehaquick | UNIX for Dummies Questions & Answers | 3 | 02-01-2008 12:09 AM |
| Detecting a key combination | mobile01 | High Level Programming | 11 | 12-22-2006 05:46 AM |
| shell help - file combination | ting123 | UNIX for Dummies Questions & Answers | 4 | 06-28-2006 09:50 PM |
| awk and file combination | sickboy | UNIX for Dummies Questions & Answers | 1 | 06-13-2005 06:02 PM |
| Partition combination | gardarm | Filesystems, Disks and Memory | 3 | 03-14-2002 03:35 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Combination Of commands
Hello All,
I just wanted to know what are the different ways of using commands in combination. The most common one which i know is using pipes. Also grouping is also done like ( ls; date) where output of both the commands is displayed. Are there any other ways of combining various commands and using them on command line or in the scripts. Thanks, Rahul |
| Forum Sponsor | ||
|
|
|
|||
|
Hi,
The OR (||) and AND (&& ) operators can be used as well: ls foo && cat foo cat foo is only executed when ls foo has no errors (in this case, foo must exist) ls foo || touch foo touch foo is executes only when ls foo has an error (does not exist in this example) Hope this helps.
__________________
The dead stay dead and the living only wait to join them........ |
|
|||
|
Thanks for that help.
Also if there are any more alternatives, please keep telling me. If any links regrding this subject are available, please tell me. I also wnated to know if all the commands can be used for command substitution using back quotes ``. Are there any commands which cannot be used in substitution. Thanks, Rahul |
|||
| Google UNIX.COM |
| Thread Tools | |
| Display Modes | |
|
|