この単純なスクリプトがあるとします
#! /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]
では、スクリプトに「フラグ」チェックを追加する最も簡単な方法は何ですか?
ありがとう