The UNIX and Linux Forums  

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 -->
  #2 (permalink)  
Old 10-04-2006
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
I think the default IFS is defined to be a whitespace. So you can change the IFS to a newline and then output the desired variable
Code:
first=HAI
second=HELLO
oldifs="$IFS"
IFS='
'
third="$first $second"
echo $third
IFS="$oldifs"
Not tested tho'.