[CentOS] Get only script name with shell script
Stephen Harris
lists at spuddy.orgFri Apr 24 19:03:35 UTC 2009
- Previous message: [CentOS] Get only script name with shell script
- Next message: [CentOS] Get only script name with shell script
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [CentOS] Get only script name with shell script
- Next message: [CentOS] Get only script name with shell script
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list