$ readlink /proc/$$/exe
例如:
$ readlink /proc/$$/exe
/usr/bin/bash
例2:
$ cat t.sh
#!/bin/bash
readlink /proc/$$/exe
$ ./t.sh
/usr/bin/bash
例2:
$ cat t.sh
#!/bin/ksh
readlink /proc/$$/exe
$ ./t.sh
/usr/bin/ksh93
例3:
$ cat t.sh
#!/bin/ksh
readlink /proc/$$/exe
$ bash t.sh
/usr/bin/bash
网友评论