Iterative statement to cut values from a line

Hi I am new to shell scripting and trying to get values from a text file,

I have a text file with values seperated with "|". like

aga|120220090525|120220090525|120220090525|120220090530
bab|120220090530|120220090530|120220090535|120220090535|120220090535
afsdv|120220090540|120220090540|120220090540

My requirement is to fetch each value seperated with "|" and put it in a seperate strings in a iterative statement..like

string1 : aga
string2 : 120220090525
string3 :120220090525
string4 :120220090525
string5 :120220090530

If you search this forum, you will probably find your answer.

But...
This 'smells' of a homework assignment.
Can you explain the real-life purpose to your request?

I have a text file with different WLS domain names, admin and managed server's IP address. Through this script I have to fetch the domain name, server IP and connect to WLS server to get the domain configurations in a single loop. Hope this clarifies.

Your first example showed daa lines with 5, 6, 4 variables on each line. What you just described is a more fixed data layout.

The basic format is:

> VAR2=`echo "aga|120220090525|120220090525|120220090525|120220090530" | cut -d"|" -f2`
> echo $VAR2
120220090525

Which of the fields are which? Do you need to map all 6 fields if they exist?

Perhaps another example file will make clearer.

Example file:
domain1|admin_url|man1_ulr|man2_url
domain2|admin_url|man1_url|man2_url|man3_url
domain3|admin_url|man1_url|man2_url|man3_url|man4_url

I need a iterative statement which checks each server status in a domain fetching from the line which is returned based on the domain name.

take the domain name
fetch the line, take the first url, check the status of the server and so on till the end of line.