Martin Brišiak Martin Brišiak - 1 year ago 74
Bash Question

reference array of folders without variable

If i can get actual folder as array thanks to:


and then I can count elements of this array like this:


How can I do it without assign it to a variable? Something like this:


Answer Source

bash does not have anonymous arrays. You have to create and populate an array variable, then apply a parameter expansion operator to it. That said, there are alternatives to using an array; @sorontar provides one that is often feasible.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download