📄 mytar2
字号:
#!/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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -