dimanche 16 novembre 2014

Bash: saving ls in an array -> receiving only small letters


Vote count:

0




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[@]}"


asked 35 secs ago







Bash: saving ls in an array -> receiving only small letters

Aucun commentaire:

Enregistrer un commentaire