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 11:45:26AM -0700, Paul Heinlein wrote:
> $(basename $0)


Since you're using $() syntax, you can probably use the extended
shell variable expressions
  ${0##*/}
and avoid running an external program :-)

(works in ksh, bash, zsh but not original traditional sh)

-- 

rgds
Stephen
_______________________________________________
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