From: David Douthitt Date: 2002-06-14T08:13:15+09:00 Subject: UNIX pipes This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. ----=_NextPart_ST_17_54_30_Thursday_June_13_2002_10939 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable I thought I could do: @snaptime =3D `/usr/contrib/bin/gunzip -lv #{file} | /usr/bin/sed 's/^[^ ]*= [^ ]* \(... .. ..:..\).*/\1/'`.chomp p @snaptime =2E..and it should (to me, anyway) return: "Jun 12 13:54" =2E..instead of the odd result of: "\001" What gives? That's not a returned error code, is it? I tried "system()" but it doesn't return a string the way I want, and it di= dn't work anyway. What's the accepted way to use a UNIX pipe? I wound up using Ruby commands= instead of sed... ----=_NextPart_ST_17_54_30_Thursday_June_13_2002_10939 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I thought I could do:
 
@snaptime =3D `/usr/contrib/bin/gunzip -lv #{file} | /usr/bin/sed 's/^[^ ]* [^ ]* \(... .. ..:..\).*/\1/'`.chomp
p @snaptime
 
...and it should (to me, anyway) return:
 
"Jun 12 13:54"
 
...instead of the odd result of:
 
"\001"
 
What gives?  That's not a returned error code, is it?
 
I tried "system()" but it doesn't return a string the w= ay I=20 want, and it didn't work anyway.
 
What's the accepted way to use a UNIX pipe?  I wou= nd up=20 using Ruby commands instead of sed...
 
----=_NextPart_ST_17_54_30_Thursday_June_13_2002_10939--