Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i want to ask if i can execute command within command ? like :- command (other command)

share|improve this question
    
Do you want the output of (other command) to be passed to command or are you trying to achieve something else ? –  Iain Sep 13 '10 at 10:55
    
yes exactly i want to use the output of command to passed it to other command –  Mohammad AL-Rawabdeh Sep 13 '10 at 11:11
    
Then pipes are what you want. –  Iain Sep 13 '10 at 11:57

2 Answers 2

up vote 5 down vote accepted

sounds like you want "piping"

as in: ls -1 | grep "txt"

share|improve this answer
    
Piping is definitely the answer :-) –  chunkyb2002 Sep 13 '10 at 11:11

$() can be used and for bash are preferred over backticks, but are not portable.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.