#! /bin/bash # serch directory of cd IFS=: for n in $CDPATH do if [ -d $n/$1 ]; then (cd $n/$1; pwd ) fi done