I tried a lot of things, but this design does not want to work in any way
#!/bin/bash
trap 'echo "# $BASH_COMMAND";read' DEBUG
test () {
case "$2" in
3) echo "3"
;;
4) echo "4"
;;
esac
}
while :
do
case "$1" in
1) echo "1" ;;
2) test;;
esac
done
if i use case in case it/s work, and when i use read to $2 it work, but i want to work with keys from command line
test(not a good function name, BTW) without any arguments.$2withintestis not set.$1,$2, ... will be the arguments your script was called with (unless re-set usingset), but inside of a function those will have the values of the arguments to that function and you calledtestwithout any arguments.