I wrote this function in bash that basically loops each file I have in my main directory that ends with .m
and then in each file reads line by line and takes from this line: place, name, points and print it.
My problem is that after echo
, the function doesn't print a newline.
I can't use echo -e
which I saw many solutions like this but I can't find solutions without using it .
Here is an idea of what I am working with:
function print {
for file in *.m; do
while read f ; do
local name="`get_name $num`"
local points="`get_points $num`"
local place="`echo "$f" | get_place $2`"
echo "$file $name $points $place"
done < "$file"
done
}