jekyll build from Action ed28bc43cd8573a879bc73ebd44c2f8a2cb9add0
This commit is contained in:
parent
00dc1d2cd2
commit
babcd3a636
@ -335,7 +335,6 @@ func<span class="o">()</span> <span class="o">{</span>
|
|||||||
|
|
||||||
<span class="c"># The while loop is important here otherwise our script will exit</span>
|
<span class="c"># The while loop is important here otherwise our script will exit</span>
|
||||||
<span class="c"># before we manage to get a chance to send a signal.</span>
|
<span class="c"># before we manage to get a chance to send a signal.</span>
|
||||||
<span class="nv">i</span><span class="o">=</span>1
|
|
||||||
<span class="k">while </span><span class="nb">true</span> <span class="p">;</span> <span class="k">do
|
<span class="k">while </span><span class="nb">true</span> <span class="p">;</span> <span class="k">do
|
||||||
</span><span class="nb">echo</span> <span class="s2">"waiting SIGUSR1"</span>
|
</span><span class="nb">echo</span> <span class="s2">"waiting SIGUSR1"</span>
|
||||||
<span class="nb">sleep </span>1
|
<span class="nb">sleep </span>1
|
||||||
@ -526,7 +525,7 @@ killing 3124876
|
|||||||
</code></pre></div></div>
|
</code></pre></div></div>
|
||||||
|
|
||||||
<h3 id="final-words">Final words</h3>
|
<h3 id="final-words">Final words</h3>
|
||||||
<p>I think I am started to getting obsessed with <code class="language-plaintext highlighter-rouge">trap</code> command because it has such a good name and use case. FOSS folks are really on another level when it comes to naming. Here is another good one:</p>
|
<p>I think I am started to getting obsessed with <code class="language-plaintext highlighter-rouge">trap</code> command because it has such a good name and purpose. FOSS folks are really on another level when it comes to naming. Here is another good one:</p>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p>- How can you see the contents of a file? <br />
|
<p>- How can you see the contents of a file? <br />
|
||||||
|
5
feed.xml
5
feed.xml
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.2.1">Jekyll</generator><link href="https://sahinakkaya.dev/feed.xml" rel="self" type="application/atom+xml" /><link href="https://sahinakkaya.dev/" rel="alternate" type="text/html" /><updated>2023-01-16T04:38:20+00:00</updated><id>https://sahinakkaya.dev/feed.xml</id><title type="html">Şahin Akkaya’s Personal Page</title><subtitle>Şahin Akkaya's personal blog - a perfectionist who likes to tinker everything until it is just right. Get ready to find some sweet tips that will boost your productivity and make you fall in love with your computer.</subtitle><author><name>Şahin Akkaya</name></author><entry><title type="html">Hot-Reload Long Running Shell Scripts (feat. trap / kill)</title><link href="https://sahinakkaya.dev/2023/01/15/hot-reloading-with-trap-and-kill.html" rel="alternate" type="text/html" title="Hot-Reload Long Running Shell Scripts (feat. trap / kill)" /><published>2023-01-15T21:48:08+00:00</published><updated>2023-01-15T21:48:08+00:00</updated><id>https://sahinakkaya.dev/2023/01/15/hot-reloading-with-trap-and-kill</id><content type="html" xml:base="https://sahinakkaya.dev/2023/01/15/hot-reloading-with-trap-and-kill.html"><h2 id="trap-them-and-kill-them"><code class="language-plaintext highlighter-rouge">trap</code> them and <code class="language-plaintext highlighter-rouge">kill</code> them!</h2>
|
<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.2.1">Jekyll</generator><link href="https://sahinakkaya.dev/feed.xml" rel="self" type="application/atom+xml" /><link href="https://sahinakkaya.dev/" rel="alternate" type="text/html" /><updated>2023-01-16T10:26:30+00:00</updated><id>https://sahinakkaya.dev/feed.xml</id><title type="html">Şahin Akkaya’s Personal Page</title><subtitle>Şahin Akkaya's personal blog - a perfectionist who likes to tinker everything until it is just right. Get ready to find some sweet tips that will boost your productivity and make you fall in love with your computer.</subtitle><author><name>Şahin Akkaya</name></author><entry><title type="html">Hot-Reload Long Running Shell Scripts (feat. trap / kill)</title><link href="https://sahinakkaya.dev/2023/01/15/hot-reloading-with-trap-and-kill.html" rel="alternate" type="text/html" title="Hot-Reload Long Running Shell Scripts (feat. trap / kill)" /><published>2023-01-15T21:48:08+00:00</published><updated>2023-01-15T21:48:08+00:00</updated><id>https://sahinakkaya.dev/2023/01/15/hot-reloading-with-trap-and-kill</id><content type="html" xml:base="https://sahinakkaya.dev/2023/01/15/hot-reloading-with-trap-and-kill.html"><h2 id="trap-them-and-kill-them"><code class="language-plaintext highlighter-rouge">trap</code> them and <code class="language-plaintext highlighter-rouge">kill</code> them!</h2>
|
||||||
|
|
||||||
<p>There is a beautiful command in Linux called <a href="https://man7.org/linux/man-pages/man1/trap.1p.html"><code class="language-plaintext highlighter-rouge">trap</code></a> which <em>trap</em>s signals and let you run specific commands when they invoked. There is also good ol’ <a href="https://man7.org/linux/man-pages/man1/kill.1.html"><code class="language-plaintext highlighter-rouge">kill</code></a> command which not only kills processes but allows you to specify a signal to send. By combining these two, you can run specific functions from your scripts any time!</p>
|
<p>There is a beautiful command in Linux called <a href="https://man7.org/linux/man-pages/man1/trap.1p.html"><code class="language-plaintext highlighter-rouge">trap</code></a> which <em>trap</em>s signals and let you run specific commands when they invoked. There is also good ol’ <a href="https://man7.org/linux/man-pages/man1/kill.1.html"><code class="language-plaintext highlighter-rouge">kill</code></a> command which not only kills processes but allows you to specify a signal to send. By combining these two, you can run specific functions from your scripts any time!</p>
|
||||||
|
|
||||||
@ -19,7 +19,6 @@ func<span class="o">()</span> <span class="o"
|
|||||||
|
|
||||||
<span class="c"># The while loop is important here otherwise our script will exit</span>
|
<span class="c"># The while loop is important here otherwise our script will exit</span>
|
||||||
<span class="c"># before we manage to get a chance to send a signal.</span>
|
<span class="c"># before we manage to get a chance to send a signal.</span>
|
||||||
<span class="nv">i</span><span class="o">=</span>1
|
|
||||||
<span class="k">while </span><span class="nb">true</span> <span class="p">;</span> <span class="k">do
|
<span class="k">while </span><span class="nb">true</span> <span class="p">;</span> <span class="k">do
|
||||||
</span><span class="nb">echo</span> <span class="s2">"waiting SIGUSR1"</span>
|
</span><span class="nb">echo</span> <span class="s2">"waiting SIGUSR1"</span>
|
||||||
<span class="nb">sleep </span>1
|
<span class="nb">sleep </span>1
|
||||||
@ -210,7 +209,7 @@ killing 3124876
|
|||||||
</code></pre></div></div>
|
</code></pre></div></div>
|
||||||
|
|
||||||
<h3 id="final-words">Final words</h3>
|
<h3 id="final-words">Final words</h3>
|
||||||
<p>I think I am started to getting obsessed with <code class="language-plaintext highlighter-rouge">trap</code> command because it has such a good name and use case. FOSS folks are really on another level when it comes to naming. Here is another good one:</p>
|
<p>I think I am started to getting obsessed with <code class="language-plaintext highlighter-rouge">trap</code> command because it has such a good name and purpose. FOSS folks are really on another level when it comes to naming. Here is another good one:</p>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p>- How can you see the contents of a file? <br />
|
<p>- How can you see the contents of a file? <br />
|
||||||
|
@ -55,6 +55,6 @@
|
|||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://sahinakkaya.dev/assets/docs/resume.pdf</loc>
|
<loc>https://sahinakkaya.dev/assets/docs/resume.pdf</loc>
|
||||||
<lastmod>2023-01-16T04:38:14+00:00</lastmod>
|
<lastmod>2023-01-16T10:26:24+00:00</lastmod>
|
||||||
</url>
|
</url>
|
||||||
</urlset>
|
</urlset>
|
||||||
|
Loading…
Reference in New Issue
Block a user