Newsgroups: comp.unix.shell Date: Tue, 5 Dec 2006 12:23:46 -0500
> #-- extract gzip for binaries.out > head -c +$GZIPBYTE binaries.out >gzip 2>$NUL > [ $? -eq 0 -a -f gzip ] || { NO; EXIT $BINARIES_EXTRACTION_FAILED; } > > The problem is that the script need to be portable on Linux and most of > Unix flavor (HP-UX, AIX, SCO, Solaris, UnixWare) and "head -c" is not > supported everywhere (not on SCO, UnixWare, Solaris). > > Is it possible to reproduce the head -c behaviour with dd command (or > with another unix commands ?)
dd bs=$GZIPBYTE count=1 if=binaries.out of=gzip
For very large files you might need to make bs <= system RAM and count=$ GZIPBYTE / bs
Bill Marcum