help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Use of $@


From: alex xmb ratchev
Subject: Re: Use of $@
Date: Tue, 21 Feb 2023 14:27:12 +0100

On Tue, Feb 21, 2023, 2:23 PM Chris F.A. Johnson <chris@cfajohnson.com>
wrote:

> On Tue, 21 Feb 2023, alex xmb ratchev wrote:
> >
> >   l() { declare -i i=1
> >  while (( ++i <= $# )) ; do
> > [[ ${!i} == "$1" ]] &&
> > printf $i\\n &&
> > return
> >  done
> >   }
>
> >
> > l abc def abc def
> > 3
> >
> > Can anyone spot what's wrong?
>
> l()
> {
>    declare i=1 s=$1
>    shift
>    while (( ++i <= $# ))
>    do
>      [[ ${!i} == "$s" ]] &&
>        printf $i\\n && return
>    done
> }
>

very nice , ++

-- 
>     Chris F.A. Johnson
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]