gzexe.in

来自「采用 LZ77 运算规则 压缩及解压工具」· IN 代码 · 共 55 行

IN
55
字号
:#!/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 1fires=0for i do  if test ! -f $i ; then    echo `basename $0`: $i not found    res=1    continue  fi# Try invoking the compressed executable with the original name:  sed "s,foo,$i," > g$$ <<'EOF'#!/bin/shif 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$$  fielse  echo Cannot decompress $0  exit 1fiexit $resEOF  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  fidoneexit $res

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?