标签:
$0
获取文件名和文件所在路径(如果带路径执行的花)
[root@lanny day2]# cat n.sh dirname $0 basename $0 [root@lanny day2]# sh `pwd`/n.sh /server/scripts/day2 n.sh [root@lanny day2]# dirname /server/scripts/day2/n.sh /server/scripts/day2 [root@lanny day2]# basename /server/scripts/day2/n.sh n.sh
标签:
原文地址:http://www.cnblogs.com/iiiiher/p/5525094.html