I am using the combination of the ls + sed to make a list of the images in the folder and create output file of scpeficic format where each line separated by the empty line etc
ls ${blocks}/*png | sed 's/^/\n/' > ${blocks}/out
The problem is that, inspite of the \n in the end sed does not add a "new line" after each string.
also would it be better to use find instead of ls for big number of png images?
Parsing output of
lscan be error prone and must be avoided. Moreover bsdseddoesn't interpret\nas newline like you're using and emits a literalnin the substitution.However, you don't even need
ls | sedhere, just use this for loop:Or better just
printf: