<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: BASH: Split a string without &#8216;cut&#8217; or &#8216;awk&#8217;</title>
	<atom:link href="http://antonolsen.com/2006/04/10/bash-split-a-string-without-cut-or-awk/feed/" rel="self" type="application/rss+xml" />
	<link>http://antonolsen.com/2006/04/10/bash-split-a-string-without-cut-or-awk/</link>
	<description>Making Mistakes as Fast as I Can.</description>
	<lastBuildDate>Tue, 16 Mar 2010 20:53:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: andu</title>
		<link>http://antonolsen.com/2006/04/10/bash-split-a-string-without-cut-or-awk/comment-page-1/#comment-4277</link>
		<dc:creator>andu</dc:creator>
		<pubDate>Mon, 21 Dec 2009 01:37:40 +0000</pubDate>
		<guid isPermaLink="false">http://antonolsen.com/?p=116#comment-4277</guid>
		<description>somethings big things really come in small packages
great thing :)</description>
		<content:encoded><![CDATA[<p>somethings big things really come in small packages<br />
great thing <img src='http://antonolsen.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harald Strack</title>
		<link>http://antonolsen.com/2006/04/10/bash-split-a-string-without-cut-or-awk/comment-page-1/#comment-1593</link>
		<dc:creator>Harald Strack</dc:creator>
		<pubDate>Fri, 29 May 2009 09:00:10 +0000</pubDate>
		<guid isPermaLink="false">http://antonolsen.com/?p=116#comment-1593</guid>
		<description>Hi,

redefinig IFS did work only on Linux, not on Solaris. So I wrote
a loop to split the input data into an array. 

#!/bin/bash
declare -a Array

original=&#039;string1 with spaces ~string2~string3~;; special chars \\;~last thing&#039;
rest=$original
i=0

#create Array from line separated by ~
while true; do
        restTmp=$rest
        part1=${rest%%~*}; rest=${rest#*~}
        Array[$i]=&quot;$part1&quot;
        #echo $rest
        i=`expr $i + 1`
        if [ &quot;$rest&quot; == &quot;$restTmp&quot; ]; then
                break
        fi
done

#access Array
echo &quot;Array[0]=${Array[0]}&quot;
echo &quot;Array[1]=${Array[1]}&quot;
echo &quot;Array[2]=${Array[2]}&quot;
echo &quot;Array[3]=${Array[3]}&quot;
echo &quot;Array[4]=${Array[4]}&quot;

br

Harald Strack</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>redefinig IFS did work only on Linux, not on Solaris. So I wrote<br />
a loop to split the input data into an array. </p>
<p>#!/bin/bash<br />
declare -a Array</p>
<p>original=&#8217;string1 with spaces ~string2~string3~;; special chars \\;~last thing&#8217;<br />
rest=$original<br />
i=0</p>
<p>#create Array from line separated by ~<br />
while true; do<br />
        restTmp=$rest<br />
        part1=${rest%%~*}; rest=${rest#*~}<br />
        Array[$i]=&#8221;$part1&#8243;<br />
        #echo $rest<br />
        i=`expr $i + 1`<br />
        if [ "$rest" == "$restTmp" ]; then<br />
                break<br />
        fi<br />
done</p>
<p>#access Array<br />
echo &#8220;Array[0]=${Array[0]}&#8221;<br />
echo &#8220;Array[1]=${Array[1]}&#8221;<br />
echo &#8220;Array[2]=${Array[2]}&#8221;<br />
echo &#8220;Array[3]=${Array[3]}&#8221;<br />
echo &#8220;Array[4]=${Array[4]}&#8221;</p>
<p>br</p>
<p>Harald Strack</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alt</title>
		<link>http://antonolsen.com/2006/04/10/bash-split-a-string-without-cut-or-awk/comment-page-1/#comment-1591</link>
		<dc:creator>alt</dc:creator>
		<pubDate>Thu, 28 May 2009 11:01:36 +0000</pubDate>
		<guid isPermaLink="false">http://antonolsen.com/?p=116#comment-1591</guid>
		<description>Here&#039;s yet another take on it:

Splitting strings in Bash

http://codesnippets.joyent.com/posts/show/2016</description>
		<content:encoded><![CDATA[<p>Here&#8217;s yet another take on it:</p>
<p>Splitting strings in Bash</p>
<p><a href="http://codesnippets.joyent.com/posts/show/2016" rel="nofollow">http://codesnippets.joyent.com/posts/show/2016</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Hertzler</title>
		<link>http://antonolsen.com/2006/04/10/bash-split-a-string-without-cut-or-awk/comment-page-1/#comment-642</link>
		<dc:creator>Jim Hertzler</dc:creator>
		<pubDate>Fri, 05 Sep 2008 22:25:13 +0000</pubDate>
		<guid isPermaLink="false">http://antonolsen.com/?p=116#comment-642</guid>
		<description>Go to:

http://www.linuxquestions.org/questions/programming-9/bash-shell-script-split-array-383848/?posted=1#post3270996

And see:

IP=1.2.3.4; IP=(${IP//./ }); Rev=${IP[3]}.${IP[2]}.${IP[1]}.${IP[0]}</description>
		<content:encoded><![CDATA[<p>Go to:</p>
<p><a href="http://www.linuxquestions.org/questions/programming-9/bash-shell-script-split-array-383848/?posted=1#post3270996" rel="nofollow">http://www.linuxquestions.org/questions/programming-9/bash-shell-script-split-array-383848/?posted=1#post3270996</a></p>
<p>And see:</p>
<p>IP=1.2.3.4; IP=(${IP//./ }); Rev=${IP[3]}.${IP[2]}.${IP[1]}.${IP[0]}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anton</title>
		<link>http://antonolsen.com/2006/04/10/bash-split-a-string-without-cut-or-awk/comment-page-1/#comment-643</link>
		<dc:creator>Anton</dc:creator>
		<pubDate>Fri, 05 Sep 2008 15:46:49 +0000</pubDate>
		<guid isPermaLink="false">http://antonolsen.com/?p=116#comment-643</guid>
		<description>Jim,

Thanks!  I hadn&#039;t known about the IFS internal variable.</description>
		<content:encoded><![CDATA[<p>Jim,</p>
<p>Thanks!  I hadn&#8217;t known about the IFS internal variable.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim Hertzler</title>
		<link>http://antonolsen.com/2006/04/10/bash-split-a-string-without-cut-or-awk/comment-page-1/#comment-647</link>
		<dc:creator>Jim Hertzler</dc:creator>
		<pubDate>Fri, 05 Sep 2008 15:39:40 +0000</pubDate>
		<guid isPermaLink="false">http://antonolsen.com/?p=116#comment-647</guid>
		<description>#!/bin/bash
# Split the command line argument on the colon character.

IFS=&quot;:&quot;; declare -a Array=($*)

echo &quot;Array[0]=${Array[0]}&quot;
echo &quot;Array[1]=${Array[1]}&quot;
echo &quot;Array[2]=${Array[2]}&quot;
echo &quot;Array[3]=${Array[3]}&quot;</description>
		<content:encoded><![CDATA[<p>#!/bin/bash<br />
# Split the command line argument on the colon character.</p>
<p>IFS=&#8221;:&#8221;; declare -a Array=($*)</p>
<p>echo &#8220;Array[0]=${Array[0]}&#8221;<br />
echo &#8220;Array[1]=${Array[1]}&#8221;<br />
echo &#8220;Array[2]=${Array[2]}&#8221;<br />
echo &#8220;Array[3]=${Array[3]}&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eureka tips</title>
		<link>http://antonolsen.com/2006/04/10/bash-split-a-string-without-cut-or-awk/comment-page-1/#comment-646</link>
		<dc:creator>eureka tips</dc:creator>
		<pubDate>Mon, 01 Sep 2008 08:53:06 +0000</pubDate>
		<guid isPermaLink="false">http://antonolsen.com/?p=116#comment-646</guid>
		<description>This cool tip was a lot helpful one.....I did a srch for my problem of interpreting a .CSV and this works like a charm</description>
		<content:encoded><![CDATA[<p>This cool tip was a lot helpful one&#8230;..I did a srch for my problem of interpreting a .CSV and this works like a charm</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: red_team316</title>
		<link>http://antonolsen.com/2006/04/10/bash-split-a-string-without-cut-or-awk/comment-page-1/#comment-644</link>
		<dc:creator>red_team316</dc:creator>
		<pubDate>Sun, 24 Aug 2008 07:57:59 +0000</pubDate>
		<guid isPermaLink="false">http://antonolsen.com/?p=116#comment-644</guid>
		<description>You sir are Awesome! Not that this makes me enjoy bash any more(I prefer real programming languages), but this is much more understandable than that sed/awk stuff.

Bookmarked, Stumbled, Saved.</description>
		<content:encoded><![CDATA[<p>You sir are Awesome! Not that this makes me enjoy bash any more(I prefer real programming languages), but this is much more understandable than that sed/awk stuff.</p>
<p>Bookmarked, Stumbled, Saved.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim K</title>
		<link>http://antonolsen.com/2006/04/10/bash-split-a-string-without-cut-or-awk/comment-page-1/#comment-645</link>
		<dc:creator>Tim K</dc:creator>
		<pubDate>Fri, 06 Jun 2008 16:00:07 +0000</pubDate>
		<guid isPermaLink="false">http://antonolsen.com/?p=116#comment-645</guid>
		<description>Thanks, you saved me lot of time and valuable bytes!</description>
		<content:encoded><![CDATA[<p>Thanks, you saved me lot of time and valuable bytes!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steadyonabix</title>
		<link>http://antonolsen.com/2006/04/10/bash-split-a-string-without-cut-or-awk/comment-page-1/#comment-641</link>
		<dc:creator>steadyonabix</dc:creator>
		<pubDate>Mon, 17 Mar 2008 13:43:12 +0000</pubDate>
		<guid isPermaLink="false">http://antonolsen.com/?p=116#comment-641</guid>
		<description>Very elegant, you are no bookmarked!

Many thanks</description>
		<content:encoded><![CDATA[<p>Very elegant, you are no bookmarked!</p>
<p>Many thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>
