undeb
来自「手机嵌入式Linux下可用的busybox源码」· 代码 · 共 54 行
TXT
54 行
#!/bin/sh## This should work with the GNU version of tar and gzip!# This should work with the bash or ash shell!# Requires the programs (ar, tar, gzip, and the pager more or less).#usage() {echo "Usage: undeb -c package.deb <Print control file info>"echo " undeb -l package.deb <List contents of deb package>"echo " undeb -x package.deb /foo/boo <Extract deb package to this directory,"echo " put . for current directory>" exit}deb=$2 exist() {if [ "$deb" = "" ]; thenusageelif [ ! -s "$deb" ]; thenecho "Can't find $deb!"exitfi}if [ "$1" = "" ]; thenusageelif [ "$1" = "-l" ]; thenexisttype more >/dev/null 2>&1 && pager=moretype less >/dev/null 2>&1 && pager=less[ "$pager" = "" ] && echo "No pager found!" && exit(ar -p $deb control.tar.gz | tar -xzO *control ; echo -e "\nPress enter to scroll, q to Quit!\n" ; ar -p $deb data.tar.gz | tar -tzv) | $pager exitelif [ "$1" = "-c" ]; thenexistar -p $deb control.tar.gz | tar -xzO *control exitelif [ "$1" = "-x" ]; thenexistif [ "$3" = "" ]; thenusageelif [ ! -d "$3" ]; thenecho "No such directory $3!"exitfiar -p $deb data.tar.gz | tar -xzvpf - -C $3 || exit echoecho "Extracted $deb to $3!"exitelseusagefi
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?