Last active
December 15, 2015 22:59
-
-
Save delta4d/5336680 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env tcsh | |
# description: change dir based on .s | |
# with any arguments to go back | |
# TODO there is some problems with heredoc | |
set pd= | |
set cc= | |
while ( 0 == 0 ) | |
if ( -d .s ) break | |
set cc=`pwd` | |
set cc=`echo $cc | sed -e 's/.*\/\(.*\)/\1/g'` | |
if ( $# == 0 || $cc != ".s" ) set pd=$cc/$pd | |
#echo $pd | |
cd .. | |
end | |
if ( $# == 0 ) set pd=.s/$pd | |
#echo $pd | |
cd $pd | |
pwd |
This file contains hidden or 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
#!/usr/bin/env sh | |
pd= | |
while true; do | |
[[ -d .s ]] && break | |
cc=`pwd` | |
pd=${cc##*/}/$pd | |
# echo $pd | |
cd .. | |
done | |
pd=.s/$pd | |
#echo $pd | |
cd $pd | |
pwd |
longarm
commented
Apr 10, 2013
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment