Skip to content

Instantly share code, notes, and snippets.

@jinzhu
Created March 16, 2009 06:16
Show Gist options
  • Save jinzhu/79752 to your computer and use it in GitHub Desktop.
Save jinzhu/79752 to your computer and use it in GitHub Desktop.
find '/pillar/Lab/' -mindepth 1 -maxdepth 1 -type d |
while read file
do
alias ${file##*/}="'cd $file'"
done
目的:
如果存在 /pillar/Lab/hi 目录,则
alias hi='cd /pillar/Lab/hi'
通过hi转到/pillar/Lab/hi目录下,
但上面的脚本并不能正常工作,请问有什么错误吗?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment