tail of a path

Brian Fitzgerald fitz at mml0.meche.rpi.edu
Tue May 14 22:45:14 AEST 1991


afsipmh at cidsv01.cid.aes.doe.CA writes:
>Basically I want to be able to get the name of a script out
>of $0 without the path.

Use basename if it's available on your machine.  It's not a shell
builtin, though.  Use backquotes if you want to use the result in your
script.

prog=`basename $0`

Brian



More information about the Comp.unix.shell mailing list