Hi,
I'm a Python newbie and I'm wondering how I can do the following Perl thing:
open(F, 'grep -b 2004 logfile | head -1 | cut -d: -f1 |') or die "blah, blah";
$offset = <F>;
( or $offset = `grep -b 2004 logfile | head -1 | cut -d: -f1`; )
in Python. When I tried:
offset = os.popen('grep -b 2004 logfile | head -1 |cut -d: -f1').read()
I get a whole bunch of error messages --
grep: writing output: Broken pipe
Any help would be most appreciated.
Regards,
Paul