<?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>shell &#8211; Accidents Happen</title>
	<atom:link href="https://ah.thameera.com/tag/shell/feed/" rel="self" type="application/rss+xml" />
	<link>https://ah.thameera.com</link>
	<description>In the dark</description>
	<lastBuildDate>Mon, 25 Dec 2017 17:27:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">56521109</site>	<item>
		<title>Mercurial choosing Rust over Python</title>
		<link>https://ah.thameera.com/mercurial-choosing-rust-over-python/</link>
					<comments>https://ah.thameera.com/mercurial-choosing-rust-over-python/#respond</comments>
		
		<dc:creator><![CDATA[thameera]]></dc:creator>
		<pubDate>Mon, 25 Dec 2017 17:27:03 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[rust]]></category>
		<category><![CDATA[shell]]></category>
		<guid isPermaLink="false">https://ah.thameera.com/?p=703</guid>

					<description><![CDATA[According to this article in Mercurial wiki, its core is being re-written in Rust. Mercurial is one of the largest open-source Python projects in existence. This does not however mean everything will be rewritten in Rust. (Yes, this post&#8217;s heading&#8217;s not entirely accurate.) * hg is a Rust binary that embeds and uses a Python [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>According to <a href="https://www.mercurial-scm.org/wiki/OxidationPlan">this article in Mercurial wiki</a>, its core is being re-written in Rust. Mercurial is one of the largest open-source Python projects in existence. </p>
<p>This does not however mean everything will be rewritten in Rust. (Yes, this post&#8217;s heading&#8217;s not entirely accurate.)</p>
<blockquote><p>* <code>hg</code> is a Rust binary that embeds and uses a Python interpreter when appropriate (<code>hg</code> is a Python script today)</p>
<p>* Python code seemlessly calls out to functionality implemented in Rust</p></blockquote>
<p>The obvious reason for the decision is startup performance concerns, but the article also (interestingly) states:</p>
<blockquote><p>In addition to performance concerns, Python is also hindering us because it is a dynamic programming language. Mercurial is a large project by Python standards. Large projects are harder to maintain. Using a statically typed programming language that finds bugs at compile time will enable us to make wide-sweeping changes more fearlessly. This will improve Mercurial&#8217;s development velocity.</p></blockquote>
<p><a href="https://softwareengineering.stackexchange.com/questions/119306/how-was-git-designed">Git was also designed</a> with a core written in C and a host of shell scripts that call the core for additional functionality. For example, <code>rebase</code> is actually <a href="https://github.com/git/git/blob/master/git-rebase.sh">a shell script</a>.</p>
<p>However, usage of shell scripts has made porting Git to Windows a pain. See the Lessons Learned section in <a href="http://www.aosabook.org/en/git.html">this AOSA article</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ah.thameera.com/mercurial-choosing-rust-over-python/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">703</post-id>	</item>
		<item>
		<title>false</title>
		<link>https://ah.thameera.com/false/</link>
					<comments>https://ah.thameera.com/false/#respond</comments>
		
		<dc:creator><![CDATA[thameera]]></dc:creator>
		<pubDate>Tue, 05 Nov 2013 13:46:34 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[coreutils]]></category>
		<category><![CDATA[shell]]></category>
		<guid isPermaLink="false">http://ah.thameera.com/?p=525</guid>

					<description><![CDATA[K. Mandla writes on false: In fact, it’s anything but helpful. It won’t take help flags. It does what it’s supposed to do, but does it unsuccessfully, every time. Even the man page tells you that. What’s false? Every time, that’s what. Hardly helpful. Hardly useful. Just … false. It must be really hard when [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>K. Mandla writes on <a href="https://inconsolation.wordpress.com/2013/11/05/false-try-not-to-be-so-negative/">false</a>:</p>
<blockquote><p>In fact, it’s anything but helpful. It won’t take help flags. It does what it’s supposed to do, but does it unsuccessfully, every time.</p>
<p>Even the man page tells you that. What’s false? Every time, that’s what. Hardly helpful. Hardly useful. Just … false.</p></blockquote>
<p>It must be really hard when people expect you to be unsuccessful.  <img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f610.png" alt="😐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://ah.thameera.com/false/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">525</post-id>	</item>
		<item>
		<title>c for cat</title>
		<link>https://ah.thameera.com/c-for-cat/</link>
					<comments>https://ah.thameera.com/c-for-cat/#respond</comments>
		
		<dc:creator><![CDATA[thameera]]></dc:creator>
		<pubDate>Sat, 02 Nov 2013 09:20:46 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cat]]></category>
		<category><![CDATA[shell]]></category>
		<guid isPermaLink="false">http://ah.thameera.com/?p=514</guid>

					<description><![CDATA[An year-old tweet from @paul_irish: First: `sudo easy_install Pygments` Then `alias c=&#39;pygmentize -O style=monokai -f console256 -g&#39;` Yay, colorized cat!http://t.co/BFLxAbPz &#8212; Paul Irish (@paul_irish) October 14, 2012 Beautiful!]]></description>
										<content:encoded><![CDATA[<p>An year-old tweet from <a href="https://twitter.com/paul_irish">@paul_irish</a>:</p>
<blockquote class="twitter-tweet" data-width="530" data-dnt="true">
<p lang="ro" dir="ltr">First: `sudo easy_install Pygments` Then `alias c=&#39;pygmentize -O style=monokai -f console256 -g&#39;` Yay, colorized cat!<a href="http://t.co/BFLxAbPz">http://t.co/BFLxAbPz</a></p>
<p>&mdash; Paul Irish (@paul_irish) <a href="https://twitter.com/paul_irish/status/257310654631919616?ref_src=twsrc%5Etfw">October 14, 2012</a></p></blockquote>
<p><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></p>
<p>Beautiful!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ah.thameera.com/c-for-cat/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">514</post-id>	</item>
		<item>
		<title>Countdown timer shell script</title>
		<link>https://ah.thameera.com/countdown-timer-shell-script/</link>
					<comments>https://ah.thameera.com/countdown-timer-shell-script/#respond</comments>
		
		<dc:creator><![CDATA[thameera]]></dc:creator>
		<pubDate>Wed, 30 Oct 2013 15:11:43 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[timer]]></category>
		<guid isPermaLink="false">http://ah.thameera.com/?p=509</guid>

					<description><![CDATA[I made a small countdown script for the shell. It goes as follows: Some tricks used in the script include: echo -ne "blah blah \r" was used to write in the same line over and over That 19800 is the time difference from GMT 0.0 in seconds. In Sri Lanka, it&#8217;s 5.30 hrs. Yes, we&#8217;re [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I made a small countdown script for the shell. It goes as follows:</p>
<style>.gist table { margin-bottom: 0; }</style><div style="tab-size: 8" id="gist7234017" class="gist">
    <div class="gist-file" translate="no" data-color-mode="light" data-light-theme="light">
      <div class="gist-data">
        
<div class="js-gist-file-update-container js-task-list-container">
      <div id="file-countdown" class="file my-2">
    
    <div itemprop="text"
      class="Box-body p-0 blob-wrapper data type-shell  "
      style="overflow: auto" tabindex="0" role="region"
      aria-label="countdown content, created by thameera on 02:54PM on October 30, 2013."
    >

        
<div class="js-check-hidden-unicode js-blob-code-container blob-code-content">

  <template class="js-file-alert-template">
  <div data-view-component="true" class="flash flash-warn flash-full d-flex flex-items-center">
  <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
    <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg>
    <span>
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      <a class="Link--inTextBlock" href="https://github.co/hiddenchars" target="_blank">Learn more about bidirectional Unicode characters</a>
    </span>


  <div data-view-component="true" class="flash-action">        <a href="{{ revealButtonHref }}" data-view-component="true" class="btn-sm btn">    Show hidden characters
</a>
</div>
</div></template>
<template class="js-line-alert-template">
  <span aria-label="This line has hidden Unicode characters" data-view-component="true" class="line-alert tooltipped tooltipped-e">
    <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
    <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg>
</span></template>

  <table data-hpc class="highlight tab-size js-file-line-container" data-tab-size="4" data-paste-markdown-skip data-tagsearch-path="countdown">
        <tr>
          <td id="file-countdown-L1" class="blob-num js-line-number js-blob-rnum" data-line-number="1"></td>
          <td id="file-countdown-LC1" class="blob-code blob-code-inner js-file-line">#!/bin/bash</td>
        </tr>
        <tr>
          <td id="file-countdown-L2" class="blob-num js-line-number js-blob-rnum" data-line-number="2"></td>
          <td id="file-countdown-LC2" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-countdown-L3" class="blob-num js-line-number js-blob-rnum" data-line-number="3"></td>
          <td id="file-countdown-LC3" class="blob-code blob-code-inner js-file-line"># USAGE</td>
        </tr>
        <tr>
          <td id="file-countdown-L4" class="blob-num js-line-number js-blob-rnum" data-line-number="4"></td>
          <td id="file-countdown-LC4" class="blob-code blob-code-inner js-file-line"># ./countdown &lt;num of seconds&gt; &lt;msg&gt;</td>
        </tr>
        <tr>
          <td id="file-countdown-L5" class="blob-num js-line-number js-blob-rnum" data-line-number="5"></td>
          <td id="file-countdown-LC5" class="blob-code blob-code-inner js-file-line"># eg:</td>
        </tr>
        <tr>
          <td id="file-countdown-L6" class="blob-num js-line-number js-blob-rnum" data-line-number="6"></td>
          <td id="file-countdown-LC6" class="blob-code blob-code-inner js-file-line"># ./countdown 300 Time to rock!</td>
        </tr>
        <tr>
          <td id="file-countdown-L7" class="blob-num js-line-number js-blob-rnum" data-line-number="7"></td>
          <td id="file-countdown-LC7" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-countdown-L8" class="blob-num js-line-number js-blob-rnum" data-line-number="8"></td>
          <td id="file-countdown-LC8" class="blob-code blob-code-inner js-file-line">date1=$((`date +%s` + $1));</td>
        </tr>
        <tr>
          <td id="file-countdown-L9" class="blob-num js-line-number js-blob-rnum" data-line-number="9"></td>
          <td id="file-countdown-LC9" class="blob-code blob-code-inner js-file-line">shift</td>
        </tr>
        <tr>
          <td id="file-countdown-L10" class="blob-num js-line-number js-blob-rnum" data-line-number="10"></td>
          <td id="file-countdown-LC10" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-countdown-L11" class="blob-num js-line-number js-blob-rnum" data-line-number="11"></td>
          <td id="file-countdown-LC11" class="blob-code blob-code-inner js-file-line">while [ &quot;$date1&quot; -ne `date +%s` ]; do</td>
        </tr>
        <tr>
          <td id="file-countdown-L12" class="blob-num js-line-number js-blob-rnum" data-line-number="12"></td>
          <td id="file-countdown-LC12" class="blob-code blob-code-inner js-file-line">  echo -ne &quot;$(date --date @$(($date1 - `date +%s` - 19800 )) +%H:%M:%S)\r&quot;;</td>
        </tr>
        <tr>
          <td id="file-countdown-L13" class="blob-num js-line-number js-blob-rnum" data-line-number="13"></td>
          <td id="file-countdown-LC13" class="blob-code blob-code-inner js-file-line">done</td>
        </tr>
        <tr>
          <td id="file-countdown-L14" class="blob-num js-line-number js-blob-rnum" data-line-number="14"></td>
          <td id="file-countdown-LC14" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-countdown-L15" class="blob-num js-line-number js-blob-rnum" data-line-number="15"></td>
          <td id="file-countdown-LC15" class="blob-code blob-code-inner js-file-line">notify-send &#39;Timer finished&#39; &quot;$*&quot;</td>
        </tr>
        <tr>
          <td id="file-countdown-L16" class="blob-num js-line-number js-blob-rnum" data-line-number="16"></td>
          <td id="file-countdown-LC16" class="blob-code blob-code-inner js-file-line">zenity --info --title &quot;Timer finished&quot; --text &quot;$*&quot;</td>
        </tr>
  </table>
</div>


    </div>

  </div>

</div>

      </div>
      <div class="gist-meta">
        <a href="https://gist.github.com/thameera/7234017/raw/badb35da2f87d8c462c53e2e58c544060a53c21b/countdown" style="float:right" class="Link--inTextBlock">view raw</a>
        <a href="https://gist.github.com/thameera/7234017#file-countdown" class="Link--inTextBlock">
          countdown
        </a>
        hosted with &#10084; by <a class="Link--inTextBlock" href="https://github.com">GitHub</a>
      </div>
    </div>
</div>

<p>Some tricks used in the script include:</p>
<ol>
<li><code>echo -ne "blah blah \r"</code> was used to write in the same line over and over</li>
<li>That 19800 is the time difference from GMT 0.0 in seconds. In Sri Lanka, it&#8217;s 5.30 hrs. Yes, we&#8217;re dealing with epoch time here, but still trying to figure out why we need to offset the time difference.  <img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f615.png" alt="😕" class="wp-smiley" style="height: 1em; max-height: 1em;" /> </li>
<li><code>notify-send</code> sends a desktop notification</li>
<li><code>zenity --info</code> pops up a message box</li>
</ol>
<p>You can also add a sound to play with <code>mplayer</code>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ah.thameera.com/countdown-timer-shell-script/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">509</post-id>	</item>
		<item>
		<title>ShellCheck &#8211; static analyzer for shell scripts</title>
		<link>https://ah.thameera.com/shellcheck-static-analyzer-for-shell-scripts/</link>
					<comments>https://ah.thameera.com/shellcheck-static-analyzer-for-shell-scripts/#respond</comments>
		
		<dc:creator><![CDATA[thameera]]></dc:creator>
		<pubDate>Mon, 28 Oct 2013 15:45:27 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cabal]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>
		<guid isPermaLink="false">http://ah.thameera.com/?p=501</guid>

					<description><![CDATA[Just came across ShellCheck. From its About page: ShellCheck is a static analysis and linting tool for sh/bash scripts. It&#8217;s mainly focused on handling typical beginner and intermediate level syntax errors and pitfalls where the shell just gives a cryptic error message or strange behavior, but it also reports on a few more advanced issues [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Just came across <a href="http://www.shellcheck.net/">ShellCheck</a>. From its <a href="http://www.shellcheck.net/about.html">About page</a>:</p>
<blockquote><p>ShellCheck is a static analysis and linting tool for sh/bash scripts. It&#8217;s mainly focused on handling typical beginner and intermediate level syntax errors and pitfalls where the shell just gives a cryptic error message or strange behavior, but it also reports on a few more advanced issues where corner cases can cause delayed failures.</p></blockquote>
<p>Interestingly, the tool&#8217;s completely written with Haskell. You can copy/paste the script on the site, or even <a href="https://github.com/koalaman/shellcheck">install it</a> so you can conveniently check shell scripts every now and then. You need <code>cabal</code> to have installed to compile the source. On Debian, you can install the package <code>haskell-platform</code> to install <code>cabal</code>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ah.thameera.com/shellcheck-static-analyzer-for-shell-scripts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">501</post-id>	</item>
		<item>
		<title>pkill script for cygwin</title>
		<link>https://ah.thameera.com/pkill-script-for-cygwin/</link>
					<comments>https://ah.thameera.com/pkill-script-for-cygwin/#comments</comments>
		
		<dc:creator><![CDATA[thameera]]></dc:creator>
		<pubDate>Tue, 15 Oct 2013 06:12:05 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[pkill]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[windows]]></category>
		<guid isPermaLink="false">http://ah.thameera.com/?p=427</guid>

					<description><![CDATA[pkill is a basic necessity of life. For cygwin, this comes in the package procps which is not available for x64. You can of course ps and grep then awk but who has the time. This small script from cygwin mailing list archives to the rescue: tskill is actually a kill equivalent in the Windows [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>pkill is a basic necessity of life. For cygwin, this comes in the package procps which is not available for x64. You can of course ps and grep then awk but who has the time.</p>
<p>This small script from <a href="http://cygwin.com/ml/cygwin/2008-05/msg00084.html">cygwin mailing list archives</a> to the rescue:</p>
<style>.gist table { margin-bottom: 0; }</style><div style="tab-size: 8" id="gist6987212" class="gist">
    <div class="gist-file" translate="no" data-color-mode="light" data-light-theme="light">
      <div class="gist-data">
        
<div class="js-gist-file-update-container js-task-list-container">
      <div id="file-pkill" class="file my-2">
    
    <div itemprop="text"
      class="Box-body p-0 blob-wrapper data type-shell  "
      style="overflow: auto" tabindex="0" role="region"
      aria-label="pkill content, created by thameera on 06:08AM on October 15, 2013."
    >

        
<div class="js-check-hidden-unicode js-blob-code-container blob-code-content">

  <template class="js-file-alert-template">
  <div data-view-component="true" class="flash flash-warn flash-full d-flex flex-items-center">
  <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
    <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg>
    <span>
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      <a class="Link--inTextBlock" href="https://github.co/hiddenchars" target="_blank">Learn more about bidirectional Unicode characters</a>
    </span>


  <div data-view-component="true" class="flash-action">        <a href="{{ revealButtonHref }}" data-view-component="true" class="btn-sm btn">    Show hidden characters
</a>
</div>
</div></template>
<template class="js-line-alert-template">
  <span aria-label="This line has hidden Unicode characters" data-view-component="true" class="line-alert tooltipped tooltipped-e">
    <svg aria-hidden="true" data-component="Octicon" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
    <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg>
</span></template>

  <table data-hpc class="highlight tab-size js-file-line-container" data-tab-size="4" data-paste-markdown-skip data-tagsearch-path="pkill">
        <tr>
          <td id="file-pkill-L1" class="blob-num js-line-number js-blob-rnum" data-line-number="1"></td>
          <td id="file-pkill-LC1" class="blob-code blob-code-inner js-file-line">#!/bin/sh</td>
        </tr>
        <tr>
          <td id="file-pkill-L2" class="blob-num js-line-number js-blob-rnum" data-line-number="2"></td>
          <td id="file-pkill-LC2" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-pkill-L3" class="blob-num js-line-number js-blob-rnum" data-line-number="3"></td>
          <td id="file-pkill-LC3" class="blob-code blob-code-inner js-file-line"># pkill</td>
        </tr>
        <tr>
          <td id="file-pkill-L4" class="blob-num js-line-number js-blob-rnum" data-line-number="4"></td>
          <td id="file-pkill-LC4" class="blob-code blob-code-inner js-file-line"># be VERY careful with parameter $1</td>
        </tr>
        <tr>
          <td id="file-pkill-L5" class="blob-num js-line-number js-blob-rnum" data-line-number="5"></td>
          <td id="file-pkill-LC5" class="blob-code blob-code-inner js-file-line">case $1 in</td>
        </tr>
        <tr>
          <td id="file-pkill-L6" class="blob-num js-line-number js-blob-rnum" data-line-number="6"></td>
          <td id="file-pkill-LC6" class="blob-code blob-code-inner js-file-line">&#39;&#39; )</td>
        </tr>
        <tr>
          <td id="file-pkill-L7" class="blob-num js-line-number js-blob-rnum" data-line-number="7"></td>
          <td id="file-pkill-LC7" class="blob-code blob-code-inner js-file-line">  cat &quot;$0&quot;</td>
        </tr>
        <tr>
          <td id="file-pkill-L8" class="blob-num js-line-number js-blob-rnum" data-line-number="8"></td>
          <td id="file-pkill-LC8" class="blob-code blob-code-inner js-file-line">  ;;</td>
        </tr>
        <tr>
          <td id="file-pkill-L9" class="blob-num js-line-number js-blob-rnum" data-line-number="9"></td>
          <td id="file-pkill-LC9" class="blob-code blob-code-inner js-file-line">* )</td>
        </tr>
        <tr>
          <td id="file-pkill-L10" class="blob-num js-line-number js-blob-rnum" data-line-number="10"></td>
          <td id="file-pkill-LC10" class="blob-code blob-code-inner js-file-line">  for pid in $( ps -aW | grep -i $1 | awk &#39;{ print $4 }&#39; );</td>
        </tr>
        <tr>
          <td id="file-pkill-L11" class="blob-num js-line-number js-blob-rnum" data-line-number="11"></td>
          <td id="file-pkill-LC11" class="blob-code blob-code-inner js-file-line">    do tskill $pid /V;</td>
        </tr>
        <tr>
          <td id="file-pkill-L12" class="blob-num js-line-number js-blob-rnum" data-line-number="12"></td>
          <td id="file-pkill-LC12" class="blob-code blob-code-inner js-file-line">  done</td>
        </tr>
        <tr>
          <td id="file-pkill-L13" class="blob-num js-line-number js-blob-rnum" data-line-number="13"></td>
          <td id="file-pkill-LC13" class="blob-code blob-code-inner js-file-line">  ;;</td>
        </tr>
        <tr>
          <td id="file-pkill-L14" class="blob-num js-line-number js-blob-rnum" data-line-number="14"></td>
          <td id="file-pkill-LC14" class="blob-code blob-code-inner js-file-line">esac</td>
        </tr>
  </table>
</div>


    </div>

  </div>

</div>

      </div>
      <div class="gist-meta">
        <a href="https://gist.github.com/thameera/6987212/raw/b94eb33be191f747afd0416224b21b788dea16c1/pkill" style="float:right" class="Link--inTextBlock">view raw</a>
        <a href="https://gist.github.com/thameera/6987212#file-pkill" class="Link--inTextBlock">
          pkill
        </a>
        hosted with &#10084; by <a class="Link--inTextBlock" href="https://github.com">GitHub</a>
      </div>
    </div>
</div>

<p><code>tskill</code> is actually a <code>kill</code> equivalent in the Windows world.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ah.thameera.com/pkill-script-for-cygwin/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">427</post-id>	</item>
		<item>
		<title>csh woes</title>
		<link>https://ah.thameera.com/csh-woes/</link>
					<comments>https://ah.thameera.com/csh-woes/#comments</comments>
		
		<dc:creator><![CDATA[thameera]]></dc:creator>
		<pubDate>Sat, 08 Sep 2012 15:53:30 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[csh]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tcsh]]></category>
		<guid isPermaLink="false">http://noisythameera.wordpress.com/?p=64</guid>

					<description><![CDATA[One thing I hate about the C Shell is the lack of function support. You&#8217;re left with aliases but they don&#8217;t work out all the time. The other I wanted to add the git branch you&#8217;re on to the csh (tcsh, in fact) prompt. I tried out adding the following to the .cshrc: alias GIT_BRANCH_CMD &#34;sh [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>One thing I hate about the <a href="http://en.wikipedia.org/wiki/C_shell" target="_blank">C Shell</a> is the lack of function support. You&#8217;re left with <a href="http://en.wikipedia.org/wiki/Alias_(command)" target="_blank">aliases</a> but they don&#8217;t work out all the time.</p>
<p>The other I wanted to add the git branch you&#8217;re on to the csh (tcsh, in fact) prompt. I tried out adding the following to the .cshrc:</p>
<blockquote>
<pre>alias GIT_BRANCH_CMD &quot;sh -c &#039;git branch --no-color 2&gt; /dev/null&#039; | sed -e &#039;/^[^*]/d&#039; -e &#039;s/* (.*)/(1)/&#039;&quot;
alias cd &#039;chdir !*;set prompt=`whoami`@`hostname`&quot;: %~&quot;`GIT_BRANCH_CMD`&quot; &gt; &quot;&#039;
cd ~</pre>
</blockquote>
<p>But it only works when you <em>cd</em> to the directory. Out of luck when you git checkout, etc. To my knowledge csh has no advantage over <a href="http://en.wikipedia.org/wiki/Bash_(Unix_shell)" target="_blank">bash</a>, so the lesson is to use bash whenever possible.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://ah.thameera.com/csh-woes/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">64</post-id>	</item>
	</channel>
</rss>
