I'm trying to use a case statement to determine if I have a legal command. It looks something like this:
function commandTest {
case $1 in
–score) echo "something";;
*) echo "unknown";;
esac
}
Now if I use the function like this, it doesn't work. case
doesn't recognize the string correctly although it is identical.
$ commandTest "-score"
unknown
What am I doing wrong here?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…