当我编写参数时,它们应该在一个案例中进行检查,然后添加到一个列表中,如果你在前面输入 -c,参数应该是大写的,如果你输入 -4,参数应该出现 4 次
#!/bin/bash
function forloop {
for each in naam
do
echo $naam zegt je dat...
echo ""
echo
let "x+=1"
done
}
function helper {
echo "use names only."
echo "if u type -c before a word then it wil be shown in capital"
echo "if u type -(number) before a word the word will be shown (number)times "
}
naam=null
x=0
while [ $x -le 4 ]
do
case $1 in
-c) echo "${2 ^^}";shift ;;
help) helper ;shift;naam=helper;;
-4) $1x-1
exit ;shift;;
esac
naam=" $1"
shift
forloop
done
exit