Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!ispd-newsserver!garden.ssd.kodak.com!weimer From: weimer@garden.ssd.kodak.com (Gary Weimer (253-7796)) Newsgroups: comp.unix.shell Subject: Re: tail of a path Message-ID: <1991May14.210930.24111@ssd.kodak.com> Date: 14 May 91 21:09:30 GMT References: <1991May13.130524.5466@cid.aes.doe.CA> <=+_hsq.@rpi.edu> Sender: news@ssd.kodak.com Reply-To: weimer@ssd.kodak.com Distribution: na Organization: Eastman Kodak Co.; Rochester, NY Lines: 18 In article <=+_hsq.@rpi.edu>, fitz@mml0.meche.rpi.edu (Brian Fitzgerald) writes: |> 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` or if you don't have basename (or don't want to worry about it): prog=`echo $0|awk -f/ '{print $NF}'` weimer@ssd.kodak.com ( Gary Weimer )