explain the code

Hi ,

Can anyone explains what does the below highlighted statements means:

# Set environment variables
. ${0%/}/wrkenv.sh
jobName_sh=${0##
/}
jobName=${jobName_sh%.*}

Thanks,
Sri

. ${0%/*}/wrkenv.sh
gets the directory path (as is executed) of the running script and sources the script wrkenv.sh present in the above reslut directory.
If user is running a script as /home/justsam/test.sh , then the first line of the code fetches the directory (/home/justsam in this case and sources the wrkenv.sh script

jobName_sh=${0##*/}
This is meant to remove all characters before the last �/ �from the path entered to invoke the script, leaving only the name of the script.

## matches the longest match from start of the string, and looks for the last occurrence of �/� from beginning, if only # was used it would match the shortest match from start of the string, looking for the first occurrence of �/� from beginning.

jobName=${jobName_sh%.*}
This is meant to remove '.' and all the characters after the '.'
Ex: If jobName_sh in test.sh, then .sh is removed and gives the name of the file without the extension.