LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to use one commands output (http://www.linuxquestions.org/questions/linux-newbie-8/how-to-use-one-commands-output-584426/)

vkmgeek 09-13-2007 11:36 AM

how to use one commands output
 
Hi

#root#] ls `cut -d " " -f 1 temp.txt`
this commands works properly for me (I am getting one file name as an output which is required)...The output from cut command will be replaced after ls. Please correct if I am worng.

Now, the below command is not working for me; though they are similar.

#root#]grep "temp" `ls `cut -d " " -f 1 temp.txt``

Logically, I shud get some output from ls and this shud act as file name for grep command. But this is not working...


Please help

raskin 09-13-2007 02:46 PM

You tried to nest ``, but opening and closing ticks are identical. Read man bash and use $() - they can be nested.

lord-fu 09-13-2007 02:46 PM

Removed raskin owned the answer.

vkmgeek 09-15-2007 12:04 PM

hey thanks !!!


All times are GMT -5. The time now is 05:16 PM.