Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gratuitous use of echo?



 On Wed, Feb 27, 2008 at 05:06:04PM -0500, Jerry Feldman wrote: 
> Essentially, doing it the original way you proposed by assigning it to 
> a shell variable, and subsequently echoing the contents and piping it 
> though whatever tools you want to use to filter it should work fine. 

> FOO=$(someprogramthatproducesoutput) # run the command 
> echo $FOO | filter1 | filter 2 | ... | filtern > file1 
> echo $FOO | filter1 | filter 2 | ... | filtern > file2 

That is basically what I do. 

I just wondered if the 'echo $FOO' bit was overlooking some nifty way of 
getting the contents of FOO back into circulation. 

In my case, FOO typically contains a multi-line string of output from 
some long-running or CPU-intensive command, which is why I don't want to 
execute it multiple times. 

I save the output to a variable and then by playing with the IFS and 
piping it through egrep/awk/sed, I can get the useful bits out. 

-ben 

-- 
never express yourself more clearly than you think.         <neils bohr> 

-- 
This message has been scanned for viruses and 
dangerous content by MailScanner, and is 
believed to be clean. 

_______________________________________________ 
Discuss mailing list 
[hidden email] 
http://lists.blu.org/mailman/listinfo/discuss
 


BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org