tags:

views:

22

answers:

2

hi all

the following script print the $line parameter my target is to print the numbers in the $line exactly as they described as the following

example1

   12435345645645645
   6564564564565
   655656565

But the script print like that

12435345645645645 6564564564565 655656565

What need to change in the script in order to get the print as example1 (without to change $line parameter)

the scrip.ksh

 #!/bin/ksh


 line=' 12435345645645645
        6564564564565
        655656565'

print $line

./script.ksh

 12435345645645645 6564564564565 655656565
A: 

need to add "\n" on the end of the line

lidia
+1  A: 

Put quotes around the variable to preserve the newlines:

print "$line"
Dennis Williamson

related questions