Mailing List Archive


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

Re: [tlug] Sticky problem with pipes, head and tails



On 水, 2010-09-01 at 08:53 +0900, Kalin KOZHUHAROV wrote:
> You are hitting the hard coded default case (Duh!) which is naively
> coded to say "Program %s doesn't seem to exist\n" instead of showing
> you exit_status...

Yeah, I got that much.

> Why you get /usr/local/bin/r-fortune in execlp(producer, producer,
> (char *) 0) is beyond me and why use producer twice?
> 
> But why don't you put your "code" in a bash script like this:
> 
> #!/bin/sh
> /usr/bin/R --no-save --no-restore < /home/sl70/print-fortune.R  |tail
> -n  +23  | head -n -2 2> /dev/null
> 
> then execute that as a work around?

That's exactly what I'm doing. Then I call the signature program
automatically when I log in like this:

/usr/local/bin/signature -p "/usr/local/bin/r-fortune" -r -t ~/utf-sig \
-f ~/.signature3

-p specifies the program; -r means replace any existing pipes; -t is the
template file; -f is the named pipe to write to

-- 
Stuart Luppescu -=- slu .at. ccsr.uchicago.edu        
University of Chicago -=- CCSR 
才文と智奈美の父 -=-    Kernel 2.6.34-gentoo-r1                
Release 1.0.0 (silence) Wow! Thank you! [...] If I 
 am allowed to ask just one question today: How do 
 you fit 48 hours of coding in an ordinary day? Any
 hints will be appreciated ... :-)    -- Detlef
 Steuer (on 2000-02-29)       R-help (February
 2000) 
 
 
 

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links