LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

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

Rep: Reputation: 31
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
 
Old 09-13-2007, 01:46 PM   #2
raskin
Senior Member
 
Registered: Sep 2005
Location: Russia
Distribution: NixOS (http://nixos.org)
Posts: 1,893

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, 01:46 PM   #3
lord-fu
Member
 
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 01:48 PM.
 
Old 09-15-2007, 11:04 AM   #4
vkmgeek
Member
 
Registered: Feb 2006
Location: Ahmedabad
Distribution: rhel5
Posts: 185
Blog Entries: 2

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


Reply


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-17-2009 11:30 PM
Correlate output from multiple commands wendtbd Programming 4 07-18-2007 07:16 AM
Output commands when programs run? TKS Slackware 2 12-12-2005 11:07 PM
Bash: How to concatenate the output of different commands? J_Szucs Programming 1 11-13-2003 07:43 AM
Using commands to output to files, how is this done? nro Linux - Newbie 3 11-11-2003 08:38 PM


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

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