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 -->
  #1 (permalink)  
Old 04-22-2009
Calypso Calypso is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 29
reading in arguments with spaces

I want to be able to read in input which contain spaces and put that into an array. Each field should be delimeted by a space and should be a different array element. However I cant get it to work. any tips?


Code:
read input
//type field1 field2 field3
echo "$input"
array="$input"

Thanks in advance

Calypso