Newsgroups: comp.unix.shell
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!fitz
From: fitz@mml0.meche.rpi.edu (Brian Fitzgerald)
Subject: Re: tail of a path
Message-ID: <=+_hsq.@rpi.edu>
Summary: use basename
Nntp-Posting-Host: mml0.meche.rpi.edu
Organization: Rensselaer Polytechnic Institute, Troy NY
References: <1991May13.130524.5466@cid.aes.doe.CA>
Distribution: na
Date: 14 May 91 12:45:14 GMT
Lines: 11

afsipmh@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
