【求助】有什么方法实现定位shell脚本本身所在的绝对路径吗?

又被这老小子看见了^-^。
正在编辑      
跟我那个除了 style 有些不同之外, 本质上又有什么不一样的呢?      
if [ ${cmd:0:1} = / ]; then
    pathname=$cmd
else
    pathname="$rundir/$cmd"
这个是做什么用的?      
多余的吧。反正又臭又长,看的人头发蒙。      
seems like its useless. i did that in case some systems could not handle relative (symbolic) paths correctly. u can safely ignore those strange statements. anyway, i dont think my script deserves ''又臭又长". im sad to hear that. but it does not matter much at all. i just want to know how others can implement it in a better way. the fact is: no one, so far.      
你不用拿大话蒙我了。你先说在哪些系统就起了作用。
我还没见到。你给我指指      
those strange statements r useless. forget it.      
修改登陆脚本,然后就可以一直显示绝对路径      
1
原来N久以前就有人提过这种问题
2
原来楼上是考古的
3
献丑
http://www.linuxeden.com/forum/t155371.html