The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-23-2008
sreedivia sreedivia is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 5
How to remove new line char from a string

Hi
Can anyone tell me how can i remove new line character from a string.
My requirement is to read a line from a file and store it to a string.
read line
string1=$line
read line
string2=$line
echo $string1$string2

The result i am getting in different line. i want the output in the same line.
I think a newline char is getting inserted into each string.How can i remove it?