I have a script that I copyed in
/usr/bin/ups
In this script I print usage with this:
if [ ! $# == 1 ]; then
echo "Usage: $0 {start|stop|restart|status}"
exit
fi
when I run command “ups” I get this:
Usage: /usr/bin/ups {start|stop|restart|status}
How can I print usage like this:
Usage: ups {start|stop|restart|status}
The easyest way will be to do this:
if [ ! $# == 1 ]; then
echo "Usage: ups {start|stop|restart|status}"
exit
fi
but if some day I change the name of this file the usage text will be the same as before (ups).
Is there a nice way to do this?
Use
basename: