I am writing an Ash script and trying to detect whether an input variable equals to "?" or not. I found out that it is best to use case
for doing this, but I can't manage to get this working. My code is:
case $@ in
*?*) usage
operationSucceeded
exit;;
*) echo "Unknown argument: $@"
usage
operationFailed
exit $E_OPTERROR;; # DEFAULT\
esac
The first option always gets triggered, while I want it to trigger only when ?
is the variable, and the other option for everything else.