Re: Get only script name with shell script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Fri, Apr 24, 2009 at 09:35:00PM +0300, Semih Gokalp wrote:
> Hi all,
> 
> I wrote shell script and put it under the /usr/local/bin/ directory.
> 
> I use echo $0 for get script name but it has printed
> "/usr/local/bin/<scriptname>" but  i want to only print <scriptname>

	I use:

	PROGRAM=$(basename $0)

	in all my scripts to tag the name of the currently executing
	script.




							John

-- 
"I'm sorry but our engineers do not have phones."
As stated by a Network Solutions Customer Service representative when asked to
be put through to an engineer.

"My other computer is your windows box."
                                     Ralf Hildebrandt
<sxem> trying to play sturgeon while it's under attack is apparently not fun.

Attachment: pgpRlGuO3VtVd.pgp
Description: PGP signature

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux