Bluehost.com Web Hosting $6.95

piping a group of lines to a program

This is a discussion on piping a group of lines to a program within the Linux Networking forums, part of the Linux Forums category; hi all, i want to send a group of lines to a program in a script shell. now i'm ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-30-2007
rhXX
 
Posts: n/a
Default piping a group of lines to a program

hi all,

i want to send a group of lines to a program in a script shell.

now i'm using:

echo "line 1" > $TMPFILE
echo "line 2" >> $TMPFILE
....
echo "line N" >> $TMPFILE

cat $TMPFILE | prog

rm -f $TMPFILE

it seems me very primitive, create / delete a temp file only to
"group" the lines for piping

is it any method to pipe these line directly without temp file?

tks in advance

Reply With Quote
  #2 (permalink)  
Old 05-30-2007
Douglas O'Neal
 
Posts: n/a
Default Re: piping a group of lines to a program

rhXX wrote:
> hi all,
>
> i want to send a group of lines to a program in a script shell.
>
> now i'm using:
>
> echo "line 1" > $TMPFILE
> echo "line 2" >> $TMPFILE
> ...
> echo "line N" >> $TMPFILE
>
> cat $TMPFILE | prog
>
> rm -f $TMPFILE
>
> it seems me very primitive, create / delete a temp file only to
> "group" the lines for piping
>
> is it any method to pipe these line directly without temp file?
>
> tks in advance


(echo "line 1"; echo "line 2"; ... ; echo "line N") | prog
Reply With Quote
  #3 (permalink)  
Old 05-30-2007
rhXX
 
Posts: n/a
Default Re: piping a group of lines to a program

ok, tks to all for inmediatly help!

sincerely

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 01:50 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0