Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-13-2007, 11:36 AM   #1
Registered: Feb 2006
Location: Ahmedabad
Distribution: rhel5
Posts: 185
Blog Entries: 2

Rep: Reputation: 31
how to use one commands output


#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
Old 09-13-2007, 02:46 PM   #2
Senior Member
Registered: Sep 2005
Location: Russia
Distribution: NixOS (
Posts: 1,899

Rep: Reputation: 68
You tried to nest ``, but opening and closing ticks are identical. Read man bash and use $() - they can be nested.
Old 09-13-2007, 02:46 PM   #3
Registered: Apr 2005
Location: Ohio
Distribution: Slackware && freeBSD
Posts: 676

Rep: Reputation: 30
Removed raskin owned the answer.

Last edited by lord-fu; 09-13-2007 at 02:48 PM.
Old 09-15-2007, 12:04 PM   #4
Registered: Feb 2006
Location: Ahmedabad
Distribution: rhel5
Posts: 185
Blog Entries: 2

Original Poster
Rep: Reputation: 31
hey thanks !!!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Log user commands and output roulette Linux - Security 5 08-18-2009 12:30 AM
Correlate output from multiple commands wendtbd Programming 4 07-18-2007 08:16 AM
Output commands when programs run? TKS Slackware 2 12-13-2005 12:07 AM
Bash: How to concatenate the output of different commands? J_Szucs Programming 1 11-13-2003 08:43 AM
Using commands to output to files, how is this done? nro Linux - Newbie 3 11-11-2003 09:38 PM

All times are GMT -5. The time now is 03:37 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration