The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Running two commands in one line rdns UNIX for Dummies Questions & Answers 4 04-27-2009 12:04 PM
how to delete text from line starting pattern1 up to line before pattern2? repudi8or Shell Programming and Scripting 5 04-15-2008 10:25 PM
Seperate commands on the same line bobk544 Shell Programming and Scripting 3 07-28-2007 06:14 PM
code that reads commands from the standard i/p and executes the commands Phrozen Smoke High Level Programming 4 01-22-2007 02:06 AM
Commands and Command Line Flags Kedgeboy Shell Programming and Scripting 4 07-11-2005 11:23 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-20-2003
el_soldado el_soldado is offline
Registered User
  
 

Join Date: Nov 2003
Posts: 3
two commands on 1 line

wuts the command that allows u to use 2 commands on one line?
  #2 (permalink)  
Old 11-20-2003
google's Avatar
google google is offline Forum Advisor  
Moderator
  
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
Quote:
wuts the command that allows u to use 2 commands on one line?
if you dont mind, english please! Read the rules of the board.

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 (permalink)  
Old 11-20-2003
kduffin's Avatar
kduffin kduffin is offline Forum Advisor  
UN1X
  
 

Join Date: Nov 2003
Location: Maryland
Posts: 449
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:33 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0