mytar2
来自「Berkely的学生写的」· 代码 · 共 37 行
TXT
37 行
#!/bin/sh# Chapter 12 - Using options and arguments# The second version of the mytar script#!/bin/shUSAGE="Usage: `basename $0` [-c|-t] [files|directories]"if [ $# -lt 2 ] ; then echo "$USAGE" ; exit 1 ; ficase "$1" in -t) shift ; TARGS="-tvf" ; for i in "$@" ; do if [ -f "$i" ] ; then FILES=`tar $TARGS "$i" 2>/dev/null` if [ $? -eq 0 ] ; then echo ; echo "$i" ; echo "$FILES" else echo "ERROR: $i not a tar file." fi else echo "ERROR: $i not a file." fi done ;; -c) shift ; TARGS="-cvf" ; tar $TARGS archive.tar "$@" ;; *) echo "$USAGE" exit 0 ;;esacexit $?
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?