Input echo $0
Use the dot notation or the source running script
The result, but is shown - KSH, but is not what you want
For the other methods for this shell file name
CodePudding user response:
#!/bin/bashEcho $(the basename $BASH_SOURCE)
You can try