Author: GgdsGgds
Date: Jul 8, 2008 01:24
Hello everyone,
I have this simple bash script that reads from standard input and executes
some work depending on the input that it has read. The input lines are
meant to be in the form of a command followed by an argument.
#!/bin/bash
read input
#these two lines divide input in a first word and the rest; are they safe?
command=`echo ${input%%%% *}`
rest=`echo ${input#* }`
case $command in
print)
echo $rest
;;
*)
echo "wrong command"
;;
esac
Is is possible for the user to provide something to the standard input and
make this script do something different from what it was meant?
|