<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>postIt &#187; shell script</title>
	<atom:link href="https://lakm.us/postit/tag/shell-script/feed/" rel="self" type="application/rss+xml" />
	<link>https://lakm.us/postit</link>
	<description>Post-It sticky notes with PasteBin sense</description>
	<lastBuildDate>Thu, 02 Jan 2025 01:33:57 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0.18</generator>
	<item>
		<title>grep omit empty lines:

cat  &#124; grep -v &#8230;</title>
		<link>https://lakm.us/postit/2012/01/grep-omit-empty-linescat-grep-v/</link>
		<comments>https://lakm.us/postit/2012/01/grep-omit-empty-linescat-grep-v/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 06:44:07 +0000</pubDate>
		<dc:creator><![CDATA[Arif]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://xp-racy.lan/postit/2012/01/grep-omit-empty-linescat-grep-v/</guid>
		<description><![CDATA[grep omit empty lines: cat &#60;something&#62; &#124; grep -v &#34;^$&#34; I keep forgetting this regexp of &#8220;match expression at the star of the line&#8221;: the &#8220;^&#8221;]]></description>
				<content:encoded><![CDATA[<p>grep omit empty lines:</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&lt;</span>something<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #ff0000;">&quot;^$&quot;</span></pre></td></tr></table></div>

<p>I keep forgetting this regexp of &#8220;match expression at the star of the line&#8221;: the &#8220;^&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/postit/2012/01/grep-omit-empty-linescat-grep-v/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking whether /dev/video0 or /dev/tty &#8230;</title>
		<link>https://lakm.us/postit/2012/01/checking-whether-devvideo0-or-devtty/</link>
		<comments>https://lakm.us/postit/2012/01/checking-whether-devvideo0-or-devtty/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 06:39:59 +0000</pubDate>
		<dc:creator><![CDATA[Arif]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://xp-racy.lan/postit/?p=139</guid>
		<description><![CDATA[Checking whether /dev/video0 or /dev/ttyUSB0 exists or not (module is installed &#038; probed). They're recognized as "character special file" in bash &#91; -b /dev/ttyUSB0 &#93; &#38;&#38; echo &#34;char special file found&#34; &#124;&#124; echo &#34;char special file not found&#34; Compare the above to "block special file" &#91; -b /dev/sda &#93; &#38;&#38; echo &#34;block special file found&#34; [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Checking whether <code>/dev/video0<code> or <code>/dev/ttyUSB0<code> exists or not (module is installed &#038; probed). They're recognized as <em>"character special file"</em> in <code>bash</code></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-b</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>ttyUSB0 <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;char special file found&quot;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;char special file not found&quot;</span></pre></td></tr></table></div>

<p>Compare the above to <em>"block special file"</em></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-b</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sda <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;block special file found&quot;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;block special file not found&quot;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>https://lakm.us/postit/2012/01/checking-whether-devvideo0-or-devtty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unix time conversion   # EPOCH=129751 &#8230;</title>
		<link>https://lakm.us/postit/2011/02/unix-time-conversion-epoch129751/</link>
		<comments>https://lakm.us/postit/2011/02/unix-time-conversion-epoch129751/#comments</comments>
		<pubDate>Sat, 12 Feb 2011 13:52:10 +0000</pubDate>
		<dc:creator><![CDATA[Arif]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://xp-racy.lan/postit/?p=125</guid>
		<description><![CDATA[Unix time conversion $ EPOCH=1297515579843 $ echo $EPOCH &#124; cut -c1-10 1297515579 &#160; $ echo $EPOCH &#124; cut -c1-10 &#124; awk '{print strftime(&#34;%c&#34;,$1)}' Sat 12 Feb 2011 07:59:39 PM WIT]]></description>
				<content:encoded><![CDATA[<p>Unix time conversion</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #007800;">EPOCH</span>=<span style="color: #000000;">1297515579843</span>
$ <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$EPOCH</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-c1-10</span>
<span style="color: #000000;">1297515579</span>
&nbsp;
$ <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$EPOCH</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> <span style="color: #660033;">-c1-10</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print strftime(&quot;%c&quot;,$1)}'</span>
Sat <span style="color: #000000;">12</span> Feb <span style="color: #000000;">2011</span> 07:<span style="color: #000000;">59</span>:<span style="color: #000000;">39</span> PM WIT</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>https://lakm.us/postit/2011/02/unix-time-conversion-epoch129751/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>$ sleep 120 &amp;&amp; touch 120 &amp; sleep 4 &amp;&amp; to &#8230;</title>
		<link>https://lakm.us/postit/2010/03/sleep-120-touch-120-sleep-4-to/</link>
		<comments>https://lakm.us/postit/2010/03/sleep-120-touch-120-sleep-4-to/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 10:34:14 +0000</pubDate>
		<dc:creator><![CDATA[Arif]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[multithreading]]></category>
		<category><![CDATA[shell script]]></category>

		<guid isPermaLink="false">http://xp-racy.lan/postit/?p=41</guid>
		<description><![CDATA[$ sleep 120 &#38;&#38; touch 120 &#38; sleep 4 &#38;&#38; touch 4 So, how are those file touch comes up in sequence (watch the creation time) $ ls -l total 160 -rw-r--r-- 1 arif arif 0 2010-03-17 17:28 120 -rw-r--r-- 1 arif arif 0 2010-03-17 17:27 4 ...]]></description>
				<content:encoded><![CDATA[<p><code>$ sleep 120 &amp;&amp; touch 120 &amp; sleep 4 &amp;&amp; touch 4</code></p>
<p>So, how are those file <code>touch</code> comes up in sequence (watch the creation time)</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span>
total <span style="color: #000000;">160</span>
<span style="color: #660033;">-rw-r--r--</span> <span style="color: #000000;">1</span> arif arif     <span style="color: #000000;">0</span> <span style="color: #000000;">2010</span>-03-<span style="color: #000000;">17</span> <span style="color: #000000;">17</span>:<span style="color: #000000;">28</span> <span style="color: #000000;">120</span>
<span style="color: #660033;">-rw-r--r--</span> <span style="color: #000000;">1</span> arif arif     <span style="color: #000000;">0</span> <span style="color: #000000;">2010</span>-03-<span style="color: #000000;">17</span> <span style="color: #000000;">17</span>:<span style="color: #000000;">27</span> <span style="color: #000000;">4</span>
...</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>https://lakm.us/postit/2010/03/sleep-120-touch-120-sleep-4-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
