[Linux] 获取Shell脚本自身所在位置的绝对路径;

#!/bin/bash
oldwd=$(pwd)
rl_self=$(readlink -f $0)
dir_self=$(dirname $rl_self)
echo ""
echo "directory self is $dir_self"

 

posted @ 2013-02-17 14:17  scue  阅读(523)  评论(0编辑  收藏  举报