home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
GNUZIP.ZIP
/
GZEXE.IN
(
.txt
)
< prev
next >
Wrap
Microsoft Windows Help File Content
|
1993-03-28
|
1KB
|
42 lines
#!/bin/sh
# Compressor for Unix executables.
# Use this only for binaries that you do not use frequently.
# The compressed version is a shell script which decompresses itself
# after skipping 18 lines of shell commands.
if test $# = 0; then
echo compress executables. original file foo is renamed to foo~
echo usage: `basename $0` files...
exit 1
res=0
for i do
if test ! -f $i ; then
echo `basename $0`: $i not found
res=1
continue
# Try invoking the compressed executable with the original name:
sed "s,foo,$i," > g$$ <<'EOF'
#!/bin/sh
if tail +18 $0 | gzip -cd > /tmp/gztmp$$; then
chmod 755 /tmp/gztmp$$
if ln /tmp/gztmp$$ /tmp/foo 2>/dev/null; then
/tmp/foo $*
res=$?
/bin/rm -f /tmp/gztmp$$ /tmp/foo
else
/tmp/gztmp$$ $*
res=$?
/bin/rm -f /tmp/gztmp$$
echo Cannot decompress $0
exit 1
exit $res
if gzip -cv9 $i >> g$$; then
/bin/rm -f $i~
mv $i $i~
mv g$$ $i
chmod 755 $i
else
/bin/rm -f g$$
echo `basename $0`: compression not possible for $i, file unchanged.
res=1
exit $res