uu
来自「Berkely的学生写的」· 代码 · 共 41 行
TXT
41 行
#!/bin/sh# Chapter 12 - Using getopts## This wrapper script around the uuencode command demonstrates the use# of the getopts command for parsing arguments in shell scriptsUSAGE="Usage: `basename $0` [-v] [-f] [filename] [-o] [filename]";VERBOSE=falsewhile getopts f:o:v OPTION ; do case "$OPTION" in f) INFILE="$OPTARG" ;; o) OUTFILE="$OPTARG" ;; v) VERBOSE=true ;; \?) echo "$USAGE" ; exit 1 ;; esacdoneshift `echo "$OPTIND - 1" | bc`if [ -z "$1" -a -z "$INFILE" ] ; then echo "ERROR: Input file was not specified." exit 1fiif [ -z "$INFILE" ] ; then INFILE="$1" ; fi: ${OUTFILE:=${INFILE}.uu}if [ -f "$INFILE" ] ; then if [ "$VERBOSE" = "true" ] ; then echo "uuencoding $INFILE to $OUTFILE... \c" fi uuencode $INFILE $INFILE > $OUTFILE ; RET=$? if [ "$VERBOSE" = "true" ] ; then MSG="Failed" ; if [ $RET -eq 0 ] ; then MSG="Done." ; fi echo $MSG fifiexit 0
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?