Solved

Shell Script: Split string

Posted on 2006-06-30
2
6,524 Views
Last Modified: 2009-07-09
Greetings,

I have a long string like so:

STRING="233445 4504505 2828287 373349 2348445 560950 238920"

I would like to split this string up into an array of some sort then loop through the array and echo each value.

Thank you very much.
0
Comment
Question by:killroy03
2 Comments
 
LVL 4

Accepted Solution

by:
bobgunzel earned 50 total points
ID: 17017865
for i in $STRING
do
echo $i
done
0
 

Author Comment

by:killroy03
ID: 17018173
You see, this is why I LOVE EE!

Thanks a ton Bob!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now