[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Use of $@
From: |
Koichi Murase |
Subject: |
Re: Use of $@ |
Date: |
Tue, 21 Feb 2023 20:06:24 +0900 |
2023年2月21日(火) 19:28 Christof Warlich <cwarlich@gmx.de>:
> as expected. The only thing that bothers me is that I couldn't get away
> without the intermediate assignment of $@ to a new array (a): Is there
> really no way to avoid that, i.e. directly using $@ in the for-loop?
It is easy to rewrite the shell function `index' using shift as
Andreas suggests, but I assume your true question is about the way to
access $@ with a specified index. You can use ${!i}. Or if you would
like to extract multiple words in a range, you can use
"${@:i:length}".
--
Koichi
- Use of $@, Christof Warlich, 2023/02/21
- Re: Use of $@, alex xmb ratchev, 2023/02/21
- Re: Use of $@, Andreas Kusalananda Kähäri, 2023/02/21
- Re: Use of $@, Kerin Millar, 2023/02/21
- Re: Use of $@,
Koichi Murase <=
- 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, 2023/02/21
- 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