mmunir
1
I am writing script that can run on solaris 10, Linux Fedora and windows taht has cybwin installed.
I want to display a variable containing muli-line text.
using echo command, the variable display all rows in single line i.e. it loses the format.
Is there any other command that displays the text exactly multil-lined and that can run on all above mentioned platforms.
Moazzam
joeyg
2
How do you know it is multi-lined?
Are there embedded <CR> or <LF> characters?
Can you provide a sample?
Always quote variables when referencing their values:
echo "$var"
Due to the inconsistencies between different versions of echo, printf is a better choice:
printf "%s\n" "$var"