[openbeos] Re: J
- From: François Revol <revol@xxxxxxx>
- To: openbeos@xxxxxxxxxxxxx
- Date: Sun, 18 May 2003 20:32:37 +0200 (CEST)
You might want to use
query "((name=$1)&&(BEOS:TYPE=application/x-vnd.Be-directory))"
except it seems to skip folders which don't have the attribute :^)
btw, do you know $CDPATH ?
François/
En réponse à Alan Ellis <alan@xxxxxxxxxxxxxx>:
> That's super flippin' cool!
>
> 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.
>
> Alan
>
>
> Some time ago, I posted a few line script function called "j" - a tool
> for
> > jumping to directories.
> > And, as far as it goes, it is a pretty good script.
> > The problem that I have had with it is that sometimes I want to "j" to
> a
> > directory that does not have a unique name.
> > Currently, j has real issues with that (to put it nicely).
> > So I finally got frustrated enough and put a little more effort into
> j.
> > Here is the result:
> >
> > function goThere() {
> > if [ -d $1 ] ; then
> > echo $1
> > cd $1
> > return $?
> > fi
> > return 1
> > }
> >
> > function j() {
> > declare -a choices
> > choices=(`query "name=$1" | tr '\n' ' '`)
> > case "${#choices[@]}" in
> > "0") return 1;;
> > "1") goThere ${choices[@]} ; return $?;;
> > *) PS3='Choice: '
> > select curChoice in "${choices[@]}"
> > do
> > goThere $curChoice
> > if [ $? -eq 0 ] ; then
> > break
> > fi
> > done
> > esac
> > }
> >
> >
> >
> > Comments, thoughts, issues, questions?
> >
> >
> >
>
>
>
- References:
- [openbeos] J
- From: Michael Phipps
- [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] J
- From: Michael Phipps
- [openbeos] Re: J
- From: Alan Ellis