# dirname 获取父目录路径
# /server/scripts #<==dirname命令的作用是获取脚本的路径
#
dirname /server/scripts/n.sh or dirname /server/scripts/n.sh/
# 显示最后的目录名或文件名
# n.sh
basename /server/scripts/n.sh or basename /server/scripts/n.sh/
# scripts
basename /server/scripts/ or basename /server/scripts
#!/bin/bash
echo `dirname $0`
echo `basename $0`
dirname $0
basename $0
# 执行
sh /shell/bash.sh