I have a bash array with 3 elements and I need to remove the first X number characters from all the elements and the last Y number of characters from all the elements. How can this be achieved. Example below:
echo ${array[@]}
random/path/file1.txt random/path/file2.txt random/path/file3.txt
I would like this array to become
echo ${array[@]}
file1 file2 file3
How can this be achieved?