Quantcast
Channel: How does this function accessing an array work? - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 2

Answer by nezabudka for How does this function accessing an array work?

$
0
0

From man bash:

for name [ [ in [ word ... ] ] ; ] do list ; done
...
If the "in word" is omitted, the for command executes list oncefor each positional parameter that is set

In reality, it will do the same as this:

for e in "$@"; do

After the command shift, only the array elements remain in the positional parameters, which the for loop iterates over.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>