Skip to main content
deleted 19 characters in body
Source Link

Use quotes :

output=$(...) echo "$output" > $fn 

the echo line is parsed by the shell (after variable expansion), and all spaces chars between parameters are reduced to a simple space. As example :

$ var1="toto > titi > tutu > " $ echo $var1 toto titi tutu $ echo "$var1" toto titi tutu 

Use quotes :

output=$(...) echo "$output" > $fn 

the echo line is parsed by the shell (after variable expansion), and all spaces chars between parameters are reduced to a simple space. As example :

$ var1="toto > titi > tutu > " $ echo $var1 toto titi tutu $ echo "$var1" toto titi tutu 

Use quotes :

echo "$output" > $fn 

the echo line is parsed by the shell (after variable expansion), and all spaces chars between parameters are reduced to a simple space. As example :

$ var1="toto > titi > tutu > " $ echo $var1 toto titi tutu $ echo "$var1" toto titi tutu 
Source Link

Use quotes :

output=$(...) echo "$output" > $fn 

the echo line is parsed by the shell (after variable expansion), and all spaces chars between parameters are reduced to a simple space. As example :

$ var1="toto > titi > tutu > " $ echo $var1 toto titi tutu $ echo "$var1" toto titi tutu