<?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: Using cut &#8211; Shellscript string manipulation</title>
	<atom:link href="http://www.thelinuxblog.com/using-cut-shellscript-string-manipulation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thelinuxblog.com/using-cut-shellscript-string-manipulation/</link>
	<description>The Linux Blog, General Linux, Shell Scripts</description>
	<lastBuildDate>Fri, 17 May 2013 01:16:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Jay Welly</title>
		<link>http://www.thelinuxblog.com/using-cut-shellscript-string-manipulation/comment-page-1/#comment-6850</link>
		<dc:creator>Jay Welly</dc:creator>
		<pubDate>Sun, 22 Jul 2012 21:25:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.thelinuxblog.com/2007/08/26/using-cut-shellscript-string-manipulation/#comment-6850</guid>
		<description><![CDATA[Perfect tutorial, very complete. Thanks!]]></description>
		<content:encoded><![CDATA[<p>Perfect tutorial, very complete. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pmjc</title>
		<link>http://www.thelinuxblog.com/using-cut-shellscript-string-manipulation/comment-page-1/#comment-6788</link>
		<dc:creator>pmjc</dc:creator>
		<pubDate>Thu, 29 Mar 2012 15:34:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.thelinuxblog.com/2007/08/26/using-cut-shellscript-string-manipulation/#comment-6788</guid>
		<description><![CDATA[This was a greate tutorial for the cut command.  I&#039;ve bookmarked your page for a reference]]></description>
		<content:encoded><![CDATA[<p>This was a greate tutorial for the cut command.  I&#8217;ve bookmarked your page for a reference</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: supertone44</title>
		<link>http://www.thelinuxblog.com/using-cut-shellscript-string-manipulation/comment-page-1/#comment-6182</link>
		<dc:creator>supertone44</dc:creator>
		<pubDate>Wed, 08 Jun 2011 16:58:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.thelinuxblog.com/2007/08/26/using-cut-shellscript-string-manipulation/#comment-6182</guid>
		<description><![CDATA[First off, great tutorial and examples. Found exactly what I was needing. 

Can anyone explain to me what the difference is between the ` and &#039; characters. For example, in comment 3109 by thelinuxblog.com they suggested:

NAME=`echo $VAR &#124; cut -d \. -f 1`

I previously had tried wrapping it with the single quote character, which just treated the statement as a string. Can anyone shed some light on the significance of the ` character?

Thanks!]]></description>
		<content:encoded><![CDATA[<p>First off, great tutorial and examples. Found exactly what I was needing. </p>
<p>Can anyone explain to me what the difference is between the ` and &#8216; characters. For example, in comment 3109 by thelinuxblog.com they suggested:</p>
<p>NAME=`echo $VAR | cut -d \. -f 1`</p>
<p>I previously had tried wrapping it with the single quote character, which just treated the statement as a string. Can anyone shed some light on the significance of the ` character?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: challaa</title>
		<link>http://www.thelinuxblog.com/using-cut-shellscript-string-manipulation/comment-page-1/#comment-6175</link>
		<dc:creator>challaa</dc:creator>
		<pubDate>Wed, 01 Jun 2011 07:01:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.thelinuxblog.com/2007/08/26/using-cut-shellscript-string-manipulation/#comment-6175</guid>
		<description><![CDATA[super example for cut command
thanks
challaa]]></description>
		<content:encoded><![CDATA[<p>super example for cut command<br />
thanks<br />
challaa</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bobo</title>
		<link>http://www.thelinuxblog.com/using-cut-shellscript-string-manipulation/comment-page-1/#comment-6174</link>
		<dc:creator>Bobo</dc:creator>
		<pubDate>Sat, 28 May 2011 17:11:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.thelinuxblog.com/2007/08/26/using-cut-shellscript-string-manipulation/#comment-6174</guid>
		<description><![CDATA[Brilliant. You made it quick, simple, and easy.
If only all tutorials could be this way. ;)
Thanks!]]></description>
		<content:encoded><![CDATA[<p>Brilliant. You made it quick, simple, and easy.<br />
If only all tutorials could be this way. ;)<br />
Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TheLinuxBlog.com</title>
		<link>http://www.thelinuxblog.com/using-cut-shellscript-string-manipulation/comment-page-1/#comment-4558</link>
		<dc:creator>TheLinuxBlog.com</dc:creator>
		<pubDate>Sun, 12 Dec 2010 15:46:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.thelinuxblog.com/2007/08/26/using-cut-shellscript-string-manipulation/#comment-4558</guid>
		<description><![CDATA[@yaker agreed, I&#039;d like to see the last option, the first is always easy since it should be &quot;1&quot;. To get the last field, you&#039;d have to count the number of fields and specify that, or reverse the string and use cut to get the first (which was last) again.

like:&lt;code&gt; cat test.txt &#124; rev &#124; cut -d , -f 1&lt;/code&gt;]]></description>
		<content:encoded><![CDATA[<p>@yaker agreed, I&#8217;d like to see the last option, the first is always easy since it should be &#8220;1&#8243;. To get the last field, you&#8217;d have to count the number of fields and specify that, or reverse the string and use cut to get the first (which was last) again.</p>
<p>like:<code> cat test.txt | rev | cut -d , -f 1</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: yaker</title>
		<link>http://www.thelinuxblog.com/using-cut-shellscript-string-manipulation/comment-page-1/#comment-4555</link>
		<dc:creator>yaker</dc:creator>
		<pubDate>Sun, 12 Dec 2010 14:29:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.thelinuxblog.com/2007/08/26/using-cut-shellscript-string-manipulation/#comment-4555</guid>
		<description><![CDATA[it will be more comfortable if the &quot;-f&quot; param can accept fields such as &quot;first/last&quot;]]></description>
		<content:encoded><![CDATA[<p>it will be more comfortable if the &#8220;-f&#8221; param can accept fields such as &#8220;first/last&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: TheLinuxBlog.com</title>
		<link>http://www.thelinuxblog.com/using-cut-shellscript-string-manipulation/comment-page-1/#comment-3109</link>
		<dc:creator>TheLinuxBlog.com</dc:creator>
		<pubDate>Fri, 29 Jan 2010 16:22:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.thelinuxblog.com/2007/08/26/using-cut-shellscript-string-manipulation/#comment-3109</guid>
		<description><![CDATA[Hey Maga, assuming the filename in VAR doesn&#039;t have any periods in it you can use:

NAME=`echo $VAR &#124; cut -d \. -f 1`

Here is another way subtracting 5 characters (extension + blankspace) from the $VAR and using the character cut:
echo $VAR &#124; cut -c -$((`echo $VAR&#124; wc -c` - 5))

However, there are probably better ways of doing it.]]></description>
		<content:encoded><![CDATA[<p>Hey Maga, assuming the filename in VAR doesn&#8217;t have any periods in it you can use:</p>
<p>NAME=`echo $VAR | cut -d \. -f 1`</p>
<p>Here is another way subtracting 5 characters (extension + blankspace) from the $VAR and using the character cut:<br />
echo $VAR | cut -c -$((`echo $VAR| wc -c` &#8211; 5))</p>
<p>However, there are probably better ways of doing it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maga</title>
		<link>http://www.thelinuxblog.com/using-cut-shellscript-string-manipulation/comment-page-1/#comment-3107</link>
		<dc:creator>Maga</dc:creator>
		<pubDate>Fri, 29 Jan 2010 14:57:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.thelinuxblog.com/2007/08/26/using-cut-shellscript-string-manipulation/#comment-3107</guid>
		<description><![CDATA[oops, I forgot to say that I want to store the output in a variable, which was my question....

so I&#039;ve tried:

name=echo &quot;${files[$i]}&quot;&#124; cut -d &#039;.&#039; -f 1

and I don&#039;t get anything stored in the variable....]]></description>
		<content:encoded><![CDATA[<p>oops, I forgot to say that I want to store the output in a variable, which was my question&#8230;.</p>
<p>so I&#8217;ve tried:</p>
<p>name=echo &#8220;${files[$i]}&#8221;| cut -d &#8216;.&#8217; -f 1</p>
<p>and I don&#8217;t get anything stored in the variable&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maga</title>
		<link>http://www.thelinuxblog.com/using-cut-shellscript-string-manipulation/comment-page-1/#comment-3106</link>
		<dc:creator>Maga</dc:creator>
		<pubDate>Fri, 29 Jan 2010 14:54:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.thelinuxblog.com/2007/08/26/using-cut-shellscript-string-manipulation/#comment-3106</guid>
		<description><![CDATA[Awesome tutorial on cut!!! Now it&#039;s part of my bookmarks... :) 

I still have one question... I have the name of a file stored in a variable and want to get only the name, not the extension...
I&#039;ve tried 
echo ${files[$i]}&#124; cut -d &#039;.&#039; -f 1 and it doesn&#039;t work... 

could anyone tell me what am missing here?

thx!!]]></description>
		<content:encoded><![CDATA[<p>Awesome tutorial on cut!!! Now it&#8217;s part of my bookmarks&#8230; :) </p>
<p>I still have one question&#8230; I have the name of a file stored in a variable and want to get only the name, not the extension&#8230;<br />
I&#8217;ve tried<br />
echo ${files[$i]}| cut -d &#8216;.&#8217; -f 1 and it doesn&#8217;t work&#8230; </p>
<p>could anyone tell me what am missing here?</p>
<p>thx!!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
