Bash Tips

  • 获取执行脚本的目录
cd "$(dirname "$0")"
  • 打印引号
$ cat a.txt | awk '{print  "\"" $1 "\""}'
"ALFKI"
"ANATR"
"ANTON"
"AROUT"
"BERGS"
"BLAUS"
"BLONP"
......
  • Bash Profile
eval `ssh-agent` > /dev/null

alias cls='clear'
alias rgrep='grep -r -n --binary-file=without-match --exclude-dir={.svn,.git}'
alias start='start.exe'
alias npp='start "C:/Program Files/Notepad++/notepad++.exe"'

export LANG=en_US.UTF8
export LC_ALL=en_US.UTF8