[oracle@slcm05adm01 cdb1]$ cat 1.sh
#!/usr/bin/sh
DIR_NAME=$( cd $(dirname $BASH_SOURCE) && pwd)
echo $DIR_NAME
[oracle@slcm05adm01 cdb1]$ ./1.sh
/u01/wgz/post_db_creation/cdb1
shell获取执行脚本的目录
最新推荐文章于 2024-02-05 14:59:43 发布
[oracle@slcm05adm01 cdb1]$ cat 1.sh
#!/usr/bin/sh
DIR_NAME=$( cd $(dirname $BASH_SOURCE) && pwd)
echo $DIR_NAME
[oracle@slcm05adm01 cdb1]$ ./1.sh
/u01/wgz/post_db_creation/cdb1