This question concerns a bash script that is run in automator osx. I am using automator actions to get and filter a bunch of file references from the finder. Then I append t
Assuming that you already have an array, you can say:
unset "array[${#array[@]}-1]"
For example, if your script contains:
array=( "$@" )
unset "array[${#array[@]}-1]" # Removes last element -- also see: help unset
for i in "${array[@]}"; do
echo "$i"
done
invoking it with: bash scriptname foo bar baz produces:
foo
bar