<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Bash on Brandon Pugh&#39;s Blog</title>
    <link>https://www.brandonpugh.com/tags/bash/</link>
    <description>Recent content in Bash on Brandon Pugh&#39;s Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Wed, 20 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://www.brandonpugh.com/tags/bash/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Insert the last argument of the previous terminal command</title>
      <link>https://www.brandonpugh.com/til/powershell/insert-last-argument/</link>
      <pubDate>Wed, 20 May 2026 00:00:00 +0000</pubDate>
      <guid>https://www.brandonpugh.com/til/powershell/insert-last-argument/</guid>
      <description>&lt;p&gt;Today I learned that you can use &lt;code&gt;!$&lt;/code&gt; in bash to use the last argument of the previous command.&lt;/p&gt;
&lt;p&gt;The simplest example is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;mkdir /some/long/path
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; !$
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can do something similar in powershell by using a PSReadline binding:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-powershell&#34; data-lang=&#34;powershell&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;Set-PSReadLineKeyHandler&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;-Chord&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;Alt+.&amp;#34;&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;-Function&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;YankLastArg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/til/powershell/insert-last-argument/feed&quot;&gt;
      </description>
    </item>
    
    <item>
      <title>Shell Check</title>
      <link>https://www.brandonpugh.com/til/bash/shell-check/</link>
      <pubDate>Tue, 12 Mar 2024 00:00:00 +0000</pubDate>
      <guid>https://www.brandonpugh.com/til/bash/shell-check/</guid>
      <description>&lt;p&gt;Today I learned about &lt;a href=&#34;https://www.shellcheck.net/&#34;&gt;ShellCheck&lt;/a&gt; which is essentially a linter for bash scripts.&lt;/p&gt;
&lt;p&gt;You can try it on the website but I recommend installing the &lt;a href=&#34;https://marketplace.visualstudio.com/items?itemName=timonwong.shellcheck&#34;&gt;vscode extension&lt;/a&gt;.
I like that you can look up the rationale for each of the rules so it&amp;rsquo;s a great way to learn some best practices for bash scripts.&lt;/p&gt;

       &lt;hr&gt; &lt;p&gt;Thank you for keeping RSS alive. You&#39;re awesome.&lt;/p&gt; &lt;p&gt;&lt;a href=&#34;mailto:blogrss@bpugh.dev&#34;&gt;Reply by email&lt;/a&gt;&lt;/p&gt;
        &lt;img src=&quot;https://blog.bpugh.workers.dev/cdn/images?p=/til/bash/shell-check/feed&quot;&gt;
      </description>
    </item>
    
  </channel>
</rss>