I'm trying to extract the name of a script that is being run with a full path. i.e.
if the script name is /some/where/path/script_name.ksh
I'd like to extract only: script_name
i know that it is possible to do so in two phases:
echo "${0##/}" will give me script_name.ksh
and echo "${0%.}" will give me /some/where/path/script_name
and joining them:
a=`echo "${0##/}"`
echo $a
echo "${a%.}"
Does anybody know how to do this is one command, without using the temporary variable "a"?