Hello I have one bash script like this :
readarray -t a < /home/z/Systeme/Sonde/dataUser.txt
len=${#a[@]}
for((i=0; i<$len; i++));
do
du -sh ~${a[i]}
done
The file dataUser .txt now only contain username of the session in this case only z is write in the file.
In the prompt when I do du -sh ~z The result is : 415M home/z So this is working
But when I start my script the prompt display : du : cannot access 'z' : No file or directory of this type. I think this is because of the type of {a[i]} How can I solve this ? Thanks in advance !