This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find '/pillar/Lab/' -mindepth 1 -maxdepth 1 -type d | | |
while read file | |
do | |
eval "alias ${file##*/}='cd $file'" | |
done | |
if there is a directory named /pillar/Lab/hi | |
I want this script exec alias hi='cd /pillar/Lab/hi' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
NewerOlder