I want to remove the last entry in my array, and I want the array to show me that it has 1 less entry when I am using the ${#array[@]}. This is the current line I am using:
unset GreppedURLs[${#GreppedURLs[@]} -1]
Please correct me and show me the right way.
The answer you have is (nearly) correct for non-sparse indexed arrays¹:
(Note the single quotes: they prevent pathname expansion).
Demo:
Punchline
(GNU bash, version 4.2.8(1)-release (x86_64-pc-linux-gnu))
¹ @Wil provided an excellent answer that works for all kinds of arrays