0
假設我有這個簡單的腳本腳本用簡單的標誌
#! /bin/sh
if [ $# -ne 2 ]
then
echo "Usage: $0 arg1 arg2"
exit 1
fi
head $1 $2
## But this is supposed to be:
## if -f flag is set,
## call [tail $1 $2]
## else if the flag is not set
## call [head $1 $2]
那麼什麼是添加一個「標誌」檢查,我的腳本最簡單的方法?
感謝