I want to make a script that functions differently when pressed [Space] and differently when pressed [Enter] .
what i tried:
#!/bin/bash
read -n1 Input
if [[ $Input == \n ]]; then
echo "Enter is Pressed"
elif [[ $Input == "" ]]; then
echo "Space is pressed"
fi
Any suggestions or advice is very helpful. Thanks