#!/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