<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Purnank H. G. on Medium]]></title>
        <description><![CDATA[Stories by Purnank H. G. on Medium]]></description>
        <link>https://medium.com/@purnank?source=rss-6a77cb048596------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*kHuShG953L5CQaFW</url>
            <title>Stories by Purnank H. G. on Medium</title>
            <link>https://medium.com/@purnank?source=rss-6a77cb048596------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 00:31:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@purnank/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[TMUX for Productivity]]></title>
            <link>https://medium.com/@purnank/tmux-for-productivity-079182fce247?source=rss-6a77cb048596------2</link>
            <guid isPermaLink="false">https://medium.com/p/079182fce247</guid>
            <category><![CDATA[tmux]]></category>
            <dc:creator><![CDATA[Purnank H. G.]]></dc:creator>
            <pubDate>Wed, 25 Sep 2024 16:37:13 GMT</pubDate>
            <atom:updated>2024-09-25T16:37:13.985Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://github.com/tmux/tmux/wiki">TMUX</a> is a tool that lets you use many terminals in one window.</p><p>It’s like having many windows on your computer, but all in one place, configurable. It’s like looking many things at once in a single screen.</p><p>If you end up doing things parallel or in background, TMUX is the tool to use.</p><p>Let’s see it’s advantages and uses.</p><h3>Advantages of TMUX</h3><p><strong>Many terminals</strong>:</p><ul><li>You can have many terminals open at the same time.</li></ul><p><strong>Detach and reattach</strong>:</p><ul><li>You can stop using a terminal and come back to it later.</li></ul><p><strong>Manage sessions</strong>:</p><ul><li>You can give your terminals names and organize them.</li></ul><p><strong>Panes</strong>:</p><ul><li>You can split your terminal into parts to do different things at once.</li></ul><p><strong>Keyboard shortcuts</strong>:</p><ul><li>You can use special keys to do things quickly.</li></ul><p><strong>Customize</strong>:</p><ul><li>You can make TMUX look and work the way you like.</li></ul><h3>How to use TMUX</h3><p><strong>Install TMUX</strong>:</p><ul><li>You can usually find TMUX in your computer’s software store:</li><li>brew install tmux</li><li>sudo apt-get install tmux</li><li>etc.</li></ul><p><strong>Start a session</strong>:</p><ul><li>Type tmux new-session in your terminal.</li><li>Even, tmux would work.</li></ul><p><strong>Attach to a session</strong>:</p><ul><li>tmux a would attach to last session.</li><li>Type tmux attach -t &lt;session_name&gt; to attach to a particular session</li></ul><p><strong>Detach from a session</strong>:</p><ul><li>Type tmux detach to stop using a session.</li><li>Or press ^b d to detach.</li></ul><p>TMUX can be very helpful for people who use terminals or command line a lot. It can help you work faster and more efficiently.</p><p>See more at <a href="https://github.com/tmux/tmux/wiki">TMUX Website</a></p><p>In future posts let’s see configuration of tmux.</p><p>Cross posted at <a href="https://www.purnank.in/en/posts/2024/09/tmux-for-productivity/">https://www.purnank.in/en/posts/2024/09/tmux-for-productivity/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=079182fce247" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Colourful Echo in Shell Scripts]]></title>
            <link>https://medium.com/@purnank/colourful-echo-in-shell-scripts-42e0e731e71e?source=rss-6a77cb048596------2</link>
            <guid isPermaLink="false">https://medium.com/p/42e0e731e71e</guid>
            <category><![CDATA[bash-scripting]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[bash]]></category>
            <dc:creator><![CDATA[Purnank H. G.]]></dc:creator>
            <pubDate>Tue, 09 Jan 2024 16:41:33 GMT</pubDate>
            <atom:updated>2024-09-25T16:37:00.492Z</atom:updated>
            <content:encoded><![CDATA[<p>Many times, you might have have tempted to put some colors in your output of shell scripts.</p><p>Let’s learn how it is done.</p><h3>1. Basic Example</h3><p>We can use escape codes to show colors… e.g. like this:</p><pre>1echo -e     &#39;\033[1;34m Bold    Blue foreground \033[0m&#39;<br>2echo -e     &#39;\033[0;96m Normal  Bright Cyan Background \033[0m&#39;<br>3echo -e &#39;\033[0;91;103m Normal  Bright Red Foreground, Bright Yellow Background \033[0m&#39;</pre><p>The output would look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/804/0*f6iew_EF3gvqr-uo.png" /></figure><p>You can try to run the same on your bash prompt.</p><p>Let’s understand what is happening here.</p><ol><li>echo -e : This is where we tell echo command that escape codes are going to be used. Else, it will just print the string as it is without any processing.</li><li>\033[ Is where the escape starts and m Is the marker till which the pattern exists.</li><li>Please note, Sometimes, \033[ is also written as \e[</li><li>So, what does 1 and 34 mean here? Something to do with Bold and Blue…. :-)</li><li>Let’s see the table of values, and re-visit this example later in this blog.</li></ol><h3>2. Escape values and it’s codes</h3><p>Let’s see different codes for each values of formatting and colors.</p><h3>2.1. Values for formatting</h3><pre>| Format                | Code       |<br>|-----------------------|------------|<br>| Normal                | 0          |<br>| Bold                  | 1          |<br>| Italic                | 3          |<br>| Blink                 | 5          |<br>| Underline             | 4          |<br>| Dimmed                | 2          |<br></pre><h3>2.2. Values for ForeGround Colors</h3><p>Foreground ColorCodeBlack30Red31Green32Yellow33Blue34Magenta35Cyan36White37Grey90Bright Red91Bright Green92Bright Yellow93Bright Blue94Bright Magenta95Bright Cyan96Bright White97</p><h3>2.3. Values for Background Colors</h3><p>Background ColorCodeBlack40Red41Green42Yellow43Blue44Magenta45Cyan46White47Grey100Bright Red101Bright Green102Bright Yellow103Bright Blue104Bright Magenta105Bright Cyan106Bright White107</p><h3>3. Same example, again</h3><p>Let’s see the same example, but little more readable.</p><pre>1COLOR_RESET=&quot;\033[0m&quot;<br>2COLOR_BOLD_FG_BLUE=&quot;\033[1;34m&quot;<br>3COLOR_FG_BRIGHT_CYAN=&quot;\033[0;96m&quot;<br>4COLOR_FG_BRIGHT_RED_BG_BRIGHT_YELLOW=&quot;\033[0;91;103m&quot;<br>5<br>6echo -e  &quot;${COLOR_BOLD_FG_BLUE} Bold   Blue Foreground ${COLOR_RESET}&quot;<br>7echo -e  &quot;${COLOR_FG_BRIGHT_CYAN} Normal Bright Cyan Foreground ${COLOR_RESET}&quot;<br>8echo -e  &quot;${COLOR_FG_BRIGHT_RED_BG_BRIGHT_YELLOW} Normal Bright Red Foreground, Bright Yellow Background ${COLOR_RESET}&quot;</pre><p>BASH</p><p>We have used Shell variables to make things little more readable.</p><p>You can find <a href="https://gist.github.com/purnank/043d648f6cd9e9dd442c3dc7576c87d2">list of colors with name</a> at this <a href="https://gist.github.com/purnank/043d648f6cd9e9dd442c3dc7576c87d2">github gist</a></p><h3>Testing locally</h3><ol><li>Download <a href="https://gist.github.com/purnank/043d648f6cd9e9dd442c3dc7576c87d2">ansi_color_codes.sh</a></li><li>Download <a href="https://gist.github.com/purnank/85ecb03e5ee1d3d667e310626cb0e7f4">ansi_color_codes_usage.sh</a> to the same folder</li><li>Run bash ansi_color_codes_usage.sh</li><li>It is recommended to run this on your PC to see which colors suite your liking.</li></ol><p>Note: I assume, in case you are planning to change “color” of your shell scripts, you already know the way forward from here!!! Good Luck!!!</p><p>Cross posted at <a href="https://www.purnank.in/en/posts/2024/01/colorful-echo-bash-shell-script/">https://www.purnank.in/en/posts/2024/01/colorful-echo-bash-shell-script/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42e0e731e71e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>