How to find file name of the script with in a bash shell script
In Category Bash
With in a bash shell script, you can use the very first command line argument ($0) to find the name of the script. The following example explains it.
[neo@techpulp ~]# cat myscript.sh #!/bin/bash echo The script name is $0 [neo@techpulp ~]# [neo@techpulp ~]# chmod +x myscript.sh [neo@techpulp ~]# [neo@techpulp ~]# ./myscript.sh The script name is ./myscript.sh [neo@techpulp ~]#
Recent Comments