Skip to content

Instantly share code, notes, and snippets.

@Jinmo
Created April 5, 2016 14:40
Show Gist options
  • Save Jinmo/087cec3ea791bc6744dd05182855721b to your computer and use it in GitHub Desktop.
Save Jinmo/087cec3ea791bc6744dd05182855721b to your computer and use it in GitHub Desktop.
function check_space {
if [[ $1 == *[bdks';''&'' ']* ]]
then
return 0
fi
return 1
}
while :
do
echo "Your input:"
read input
if check_space "$input"
then
echo -e '\033[0;31mRestricted characters has been used\033[0m'
else
output="echo Your command is: $input"
eval $output
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment