Networking Forums

Networking Forums > Computer Networking > Linux Networking > Linux bash syntax Q:

Reply
Thread Tools Display Modes

Linux bash syntax Q:

 
 
Coenraad Loubser
Guest
Posts: n/a

 
      01-13-2005, 05:56 AM
Im posting here cuz I know you guys know!
Is there a simple way to route standard out to the parameter of a second
command...
like say you want to find a file and then less it.
something like: locate peanut.txt | less <stdin>

thanks guys!


 
Reply With Quote
 
 
 
 
Bill Marcum
Guest
Posts: n/a

 
      01-13-2005, 07:14 AM
On Thu, 13 Jan 2005 08:56:24 +0200, Coenraad Loubser
<(E-Mail Removed)> wrote:
> Im posting here cuz I know you guys know!
> Is there a simple way to route standard out to the parameter of a second
> command...
> like say you want to find a file and then less it.
> something like: locate peanut.txt | less <stdin>
>

locate peanut.txt | xargs less


--
BOFH excuse #270:

Someone has messed up the kernel pointers
 
Reply With Quote
 
Moe Trin
Guest
Posts: n/a

 
      01-14-2005, 12:02 AM
In article <cs55vr$anl$(E-Mail Removed)>, Coenraad Loubser wrote:

>Im posting here cuz I know you guys know!
>Is there a simple way to route standard out to the parameter of a second
>command...


http://tldp.org/guides.html

Dec 6 13:54 Bash-Beginners-Guide
Nov 15 08:41 abs-guide

>like say you want to find a file and then less it.
>something like: locate peanut.txt | less <stdin>


backquotes - the ones to the left of the '1' key on most keyboards.

less `locate peanut.txt`

That says take the output of the locate command and feed that to 'less'
as an argument. This is different from 'locate peanut.txt | less' which
would display the text that locate found (filenames).

Old guy

 
Reply With Quote
 
Jose Maria Lopez Hernandez
Guest
Posts: n/a

 
      01-16-2005, 05:31 PM
Coenraad Loubser wrote:
> Im posting here cuz I know you guys know!
> Is there a simple way to route standard out to the parameter of a second
> command...
> like say you want to find a file and then less it.
> something like: locate peanut.txt | less <stdin>
>
> thanks guys!


Try:
find <whatever> -exec less {} \;


--

Jose Maria Lopez Hernandez
Director Tecnico de bgSEC
(E-Mail Removed)
bgSEC Seguridad y Consultoria de Sistemas Informaticos
http://www.bgsec.com
ESPAÑA

The only people for me are the mad ones -- the ones who are mad to live,
mad to talk, mad to be saved, desirous of everything at the same time,
the ones who never yawn or say a commonplace thing, but burn, burn, burn
like fabulous yellow Roman candles.
-- Jack Kerouac, "On the Road"
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mount windows NFS share from linux syntax reader@newsguy.com Windows Networking 1 09-04-2006 09:55 PM
zmienna bash Zenon Linux Networking 1 05-07-2004 11:21 AM
Setting $TERM when using rsh and ssh with bash waterbottleboodle Linux Networking 1 11-08-2003 10:29 PM
Bash script to see if PPP link is up... Gabriel Michael Linux Networking 34 09-14-2003 03:55 PM
Bash script via inetd = no joy tylernt Linux Networking 10 09-05-2003 08:53 PM



1 2 3 4 5 6 7 8 9 10 11