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