#!/bin/bash clear [ -z $1 ]&&{ cat << ! 'doc' by Ben Okopnik - a /usr/doc info reader --------------------------------------------- Usage: doc 'doc' will list all choices matching 'xyz*'. More letters produce a narrower query. ! exit } cd /usr/doc cd $(select A in $1*;do echo $A;break;done) clear # Due to the unpredictable depth of directory structures and # the random number of 'retrievals', the loop here has to be # infinite... which makes the exit method a rather crude one. while [ 1 ] do echo 'Enter "0" to change to the parent dir; press "Ctrl-C" when done.' echo '----------------------------------------------------------------' echo B=$(select C in *;do echo $C;break;done) [ -z $B ] && B=".." if [ -d $B ] then cd ./$B clear else mc -v $B clear fi done