On Feb 15, 2002 17:10 -0800, Randy.Dunlap wrote:
> On Fri, 15 Feb 2002, Randy.Dunlap wrote:
> | On Fri, 15 Feb 2002, Andreas Dilger wrote:
> | | HDR=`binoffset $1 0x1f 0x8b 0x08 0x0`
> | | dd if=$1 bs=1 skip=$HDR | zcat | strings /dev/stdin | grep CONFIG_
>
> Interim report: I agree with the spirit of no temp. file, but one of
> zcat or strings isn't working for me when I use only pipes. The final
> output file is empty (length = 0).
>
> Hers's the current script:
>
> HDR=`binoffset $1 0x1f 0x8b 0x08 0x0`
> dd if=$1 bs=1 skip=$HDR | zcat - | strings /dev/stdin \
> | grep "[A-Za-z_0-9]=[ym]$" | sed "s/^/CONFIG_/" > $1.old.config
Hmm, I tried this, and it works with 'strings /dev/stdin < tmpfile' but
not 'cat tmpfile | strings /dev/stdin' which is sort of wierd.
I suppose you could always either:
a) fix 'strings' so that it accepts a '-' parameter to read from stdin
b) write a special-purpose 'strings | grep | sed' replacement tool for
this purpose (or even include the binoffset part and link with zlib
to do the decompression part). No idea how hard it would be. As
for speed, almost anything would be faster in-memory than writing
out the temp file.
Cheers, Andreas
-- Andreas Dilger http://sourceforge.net/projects/ext2resize/ http://www-mddsp.enel.ucalgary.ca/People/adilger/- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Sat Feb 23 2002 - 21:00:19 EST