Bash has a neat way of giving all elements in an array except the first:
"${a[@]:1}"
To get all except the last I have found:
"${a[@]:0:$((${#a[@]}-1))}"
But, man, that is ugly.
Is there an elegant alternative?
Bash has a neat way of giving all elements in an array except the first:
"${a[@]:1}"
To get all except the last I have found:
"${a[@]:0:$((${#a[@]}-1))}"
But, man, that is ugly.
Is there an elegant alternative?