I need to create script who check argument, the argument is Linux command:
cat script.sh
case "$1" in
cp|cd|ls ) exec "$0" "$1" ;;
*) echo "error: not permitted" ;;
esac
i need to add check if the first argument is exression like this :
[ -s $file ] && echo OK
so i add condition like this:
case "$1" in
cp|cd|ls| "[ -s .* ] && echo OK" ) exec "$0" "$1" ;;
*) echo "error: not permitted" ;;
esac
but it doesn't work, any idea, please