The shell script checks the number of parameters passed to it. If the number of parameters is one,
Code: Select all
dict search_word | less
Code: Select all
#!/bin/bash
if (($# == 1));
then dict $1 | less
else
if (($# > 1)); then
echo "Only one word is allowed."
exit 0
fi
echo "You must type a word to search."
fi
exit 0