[CentOS] Get only script name with shell script

Hugh E Cruickshank hugh at forsoft.com
Fri Apr 24 19:40:03 UTC 2009

From: Semih Gokalp Sent: April 24, 2009 11:35
> I use echo $0 for get script name but it has printed
> "/usr/local/bin/<scriptname>" but  i want to only print <scriptname>

Try: `basename $0`


Regards, Hugh

Hugh E Cruickshank, Forward Software, www.forward-software.com 

More information about the CentOS mailing list