Bash Script: March 2007 Archives
前提是bash脚本不能是一个symbolic link。用下面的代码,先通过which $0的到脚本所在的绝对路径,然后再通过dirname拿到脚本所在的目录
#!/bin/sh
BASE_PATH=$(dirname `which $0`)
Search
October 2008
Friends
Recent Posts
Tag Cloud
- acm
- algorithm
- apache
- bash
- basketball
- bitlbee
- blog
- book
- boot
- camera
- cnlexizer
- computer vision
- console
- daemon
- daemontools
- debian
- directx
- dll
- dotNet
- dynamic programming
- eating
- eduos
- embedded
- evc
- eye candy
- fastcgi
- firefox
- framebuffer
- freebsd
- fs
- git
- grep
- hardware
- ifconfig
- im
- inputrc
- json
- kernel
- life
- linux
- maintainance
- math
- moluser
- msmtp
- mutt
- network
- nfs
- nlp
- notebook
- patch
- performance
- perl
- php
- printf
- regex
- router
- rxvt-unicode
- scp
- screen
- sexy
- shell
- slackware
- smartphone
- ssh
- ssl
- svn
- sysrq
- toshiba
- tunnel
- urxvt
- vc
- vcs
- vfw
- wallpaper
- windows
- xargs
Categories
Powered by Movable Type
Recent Comments
FW on 【转】rxvt-unicode (urxvt) 字间距过宽的patch: pls contac
jianingy on 用正则表达式Look-Ahead做带逃逸的变量替换: 这个lc是啥意思?
cnhackTNT on 用正则表达式Look-Ahead做带逃逸的变量替换: 晕,被过滤掉了,再试
cnhackTNT on 用正则表达式Look-Ahead做带逃逸的变量替换: s/(? 这样可以
R.Q. on 个性化SSH登录: 酱紫哦,了了 ---