I am currently writing a bash scipt where i need to concatenate the results within the output variable. However I need them to be seperated by newline charcater '\n' which does not seem to work... Any ideas ???
for i in "./"*
#printf "$i $Output\n">> output.txt
Output=$Output$(printf $'\n %s %s' "$i" "$tmp" )
echo $Output> output.txt
Well looks like
echo "$str" works
because when you print the string without quotes, newline are converted to spaces !!!