The UNIX and Linux Forums  

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




Thread: split a string
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-08-2006
gazingdown gazingdown is offline
Registered User
  
 

Join Date: Feb 2006
Posts: 1
split a string

Hi

I have a script that loops though lines of a file and reads each line in to a variable ($LINE).

I want to look at the line and split it into it's constituent parts.

e.g. a line might be "This is a string"
I want to then have variables set to each element thus:
A=This
B=is
C=a
D=string

I'm guessing it should be simple but cannot figure it out.