As this is a bash question and not a Bourne shell question, I'd like to
offer A Better Way.

Instead of referring to $0, just use ${0##*/}

Typically, the start of most bash or ksh scripts will say:

prog=${0##*/}

Then later on refer to ${prog}

-- 
-Time flies like the wind. Fruit flies like a banana. [EMAIL PROTECTED]
-Stranger things have happened but none stranger than this. Steven W. Orr-
Does your driver's license say Organ Donor?Black holes are where God \
-------divided by zero. Listen to me! We are all individuals!---------

On Fri, 21 Apr 2000, Gustav Schaffter wrote:

=>Hi,
=>
=>In a bash script I can look at $0 to find the name of the current script
=>file, but if it's started with a full path, I will find the full path
=>and filename in $0. 
=>
=>How can I find only the name of the script file even if it's started
=>with the full path?

On Sat, 22 Apr 2000, Mikkel L. Ellertson wrote:


=>Check out basename.


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to