I try to save the ls of an directory in an array, which works out, but when i look in the array all names of the directories and files are in small letters. What do I have to change, so that the names of files and dirs remain in their old notation ? also files like "Picture of Dog.jpg" are 3 entries in the array: Picture, of, Dog.jpg Is there a possibility to change that too ?
my code:
#!/bin/bash
currentDir="/home/marius/"
declare -l content=(` ls $currentDir `)
printf -- '%s ' "${content[@]}"