[openbeos] Re: J
- From: "Ingo Weinhold" <bonefish@xxxxxxxxxxxxxxx>
- To: openbeos@xxxxxxxxxxxxx
- Date: Sun, 18 May 2003 13:32:43 +0200 CEST
"Alan Ellis" <alan@xxxxxxxxxxxxxx> wrote:
> That's super flippin' cool!
Yep, that's true BeOS fun. :-)
> 2 bugs.
>
> If you have N choices, and you choose N + 1, then it takes you to /
> boot/home.
> You cant jump to a dir with a space in it's name.
A bit ugly though, but that should fix both:
function goThere() {
echo $1
if [ -d "$1" ] ; then
cd "$1"
return $?
fi
return 1
}
function countArgs() {
return $#
}
function j() {
choices=$(query "name=\"$1\"" | tr '\n' ' ')
eval "countArgs $choices"
case $? in
0) return 1;;
1) eval "goThere $choices" ; return $?;;
*) PS3='Choice: '
eval "\
select curChoice in ${choices};\
do\
goThere \"\$curChoice\";\
if [ \$? -eq 0 ];\
then\
break;\
fi;\
done"
esac
}
CU, Ingo
- Follow-Ups:
- [openbeos] Re: J
- From: Axel Dörfler
- References:
- [openbeos] Re: J
- From: Alan Ellis
Other related posts:
- » [openbeos] J
- » [openbeos] Re: J
- » [openbeos] Re: J
- » [openbeos] Re: J
- » [openbeos] Re: J
- » [openbeos] Re: J
- [openbeos] Re: J
- From: Axel Dörfler
- [openbeos] Re: J
- From: Alan Ellis