function err_handle {
status=$?
if [[ $status -ne 127 ]]; then
return
fi
lastcmd=$(history | tail -1 | sed 's/^ *[0-9]* *//')
read cmd args <<< "$lastcmd"
possible_cmd=$(ls /sbin/${cmd}* /bin/${cmd}* /usr/bin/${cmd}* /usr/local/bin/${cmd}* 2>/dev/null)
echo "Sorry, $cmd doesn't exist. Try $possible_cmd"
}
trap 'err_handle' ERR
# gre
grep gresource