[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Use of $@
From: |
Chris F.A. Johnson |
Subject: |
Re: Use of $@ |
Date: |
Tue, 21 Feb 2023 08:23:09 -0500 (EST) |
User-agent: |
Alpine 2.22 (DEB 394 2020-01-19) |
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
}
--
Chris F.A. Johnson
- Re: Use of $@, (continued)
- Re: Use of $@, Kerin Millar, 2023/02/21
- Re: Use of $@, Koichi Murase, 2023/02/21
- Re: Use of $@, Christof Warlich, 2023/02/21
- Re: Use of $@, alex xmb ratchev, 2023/02/21
- Re: Use of $@, alex xmb ratchev, 2023/02/21
- Re: Use of $@,
Chris F.A. Johnson <=
- Re: Use of $@, alex xmb ratchev, 2023/02/21
- Re: Use of $@, Greg Wooledge, 2023/02/21
- Re: Use of $@, Greg Wooledge, 2023/02/21
- Re: Use of $@, alex xmb ratchev, 2023/02/21
- Re: Use of $@, Kerin Millar, 2023/02/21
- Re: Use of $@, Greg Wooledge, 2023/02/21
- Re: Use of $@, Chet Ramey, 2023/02/21
- Re: Use of $@, Christof Warlich, 2023/02/23
- Re: Use of $@, alex xmb ratchev, 2023/02/23
- Re: Use of $@, Chet Ramey, 2023/02/23