jekyll build from Action e9bb986110

This commit is contained in:
sahinakkaya
2023-01-16 10:51:46 +00:00
parent 769e4394f9
commit 2ab0da8276
17 changed files with 341 additions and 341 deletions

View File

@ -1,16 +1,16 @@
<!doctype html>
<!DOCTYPE html>
<!--
Minimal Mistakes Jekyll Theme 4.24.0 by Michael Rose
Copyright 2013-2020 Michael Rose - mademistakes.com | @mmistakes
Free for personal and commercial use under the MIT license
https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE
-->
<html lang="en" class="no-js">
--><html lang="en" class="no-js">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<!-- begin _includes/seo.html --><title>Hot-Reload Long Running Shell Scripts (feat. trap / kill) - Şahin Akkayas Personal Page</title>
<meta name="description" content="trap them and kill them!">
<meta name="description" content="trap them and kill them! There is a beautiful command in Linux called trap which traps signals and let you run specific commands when they invoked. There is also good ol kill 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!">
<meta name="author" content="Şahin Akkaya">
@ -26,7 +26,7 @@
<meta property="og:url" content="https://sahinakkaya.dev/2023/01/15/hot-reloading-with-trap-and-kill.html">
<meta property="og:description" content="trap them and kill them!">
<meta property="og:description" content="trap them and kill them! There is a beautiful command in Linux called trap which traps signals and let you run specific commands when they invoked. There is also good ol kill 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!">
@ -116,13 +116,17 @@
/home/sahin/
</a>
<ul class="visible-links"><li class="masthead__menu-item">
<ul class="visible-links">
<li class="masthead__menu-item">
<a href="/">Home</a>
</li><li class="masthead__menu-item">
</li>
<li class="masthead__menu-item">
<a href="/about/">About</a>
</li><li class="masthead__menu-item">
</li>
<li class="masthead__menu-item">
<a href="/contact/">Contact</a>
</li></ul>
</li>
</ul>
<button class="search__toggle" type="button">
<span class="visually-hidden">Toggle search</span>
@ -185,7 +189,7 @@
<li><a href="https://github.com/sahinakkayadev" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-github" aria-hidden="true"></i><span class="label">sahinakkayadev</span></a></li>
<li><a href="https://github.com/sahinakkaya" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-github" aria-hidden="true"></i><span class="label">sahinakkayadev</span></a></li>
@ -272,7 +276,7 @@
<article class="page" itemscope itemtype="https://schema.org/CreativeWork">
<meta itemprop="headline" content="Hot-Reload Long Running Shell Scripts (feat. trap / kill)">
<meta itemprop="description" content="trap them and kill them!">
<meta itemprop="description" content="trap them and kill them!There is a beautiful command in Linux called trap which traps signals and let you run specific commands when they invoked. There is also good ol kill 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!">
<meta itemprop="datePublished" content="2023-01-15T21:48:08+00:00">
@ -314,8 +318,8 @@
<section class="page__content" itemprop="text">
<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>
<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>
<h3 id="basic-example">Basic Example</h3>
@ -528,10 +532,10 @@ killing 3124876
<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 people are really on another level when it comes to naming. Here is another good one:</p>
<blockquote>
<p>- How can you see the contents of a file? <br />
+ You <em><code class="language-plaintext highlighter-rouge">cat</code></em> it. <br />
- What if you want to see them in reverse order? <br />
+ You <em><code class="language-plaintext highlighter-rouge">tac</code></em> it. <br /></p>
<p>- How can you see the contents of a file? <br>
+ You <em><code class="language-plaintext highlighter-rouge">cat</code></em> it. <br>
- What if you want to see them in reverse order? <br>
+ You <em><code class="language-plaintext highlighter-rouge">tac</code></em> it. <br></p>
</blockquote>
<p>No, it is not just a joke. Try it… Man I love Gnoo slash Linux.</p>
@ -553,16 +557,7 @@ killing 3124876
</footer>
<section class="page__share">
<a href="https://twitter.com/intent/tweet?text=Hot-Reload+Long+Running+Shell+Scripts+%28feat.+trap+%2F+kill%29%20https%3A%2F%2Fsahinakkaya.dev%2F2023%2F01%2F15%2Fhot-reloading-with-trap-and-kill.html" class="btn btn--twitter" onclick="window.open(this.href, 'window', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" title="Share on Twitter"><i class="fab fa-fw fa-twitter" aria-hidden="true"></i><span> Twitter</span></a>
<a href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fsahinakkaya.dev%2F2023%2F01%2F15%2Fhot-reloading-with-trap-and-kill.html" class="btn btn--facebook" onclick="window.open(this.href, 'window', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" title="Share on Facebook"><i class="fab fa-fw fa-facebook" aria-hidden="true"></i><span> Facebook</span></a>
<a href="https://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fsahinakkaya.dev%2F2023%2F01%2F15%2Fhot-reloading-with-trap-and-kill.html" class="btn btn--linkedin" onclick="window.open(this.href, 'window', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;" title="Share on LinkedIn"><i class="fab fa-fw fa-linkedin" aria-hidden="true"></i><span> LinkedIn</span></a>
</section>
<nav class="pagination">
@ -783,13 +778,15 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
<div class="search-content">
<div class="search-content__inner-wrap"><form class="search-content__form" onkeydown="return event.key != 'Enter';">
<div class="search-content__inner-wrap">
<form class="search-content__form" onkeydown="return event.key != 'Enter';">
<label class="sr-only" for="search">
Enter your search term...
</label>
<input type="search" id="search" class="search-input" tabindex="-1" placeholder="Enter your search term..." />
<input type="search" id="search" class="search-input" tabindex="-1" placeholder="Enter your search term...">
</form>
<div id="results" class="results"></div></div>
<div id="results" class="results"></div>
</div>
</div>
@ -811,7 +808,7 @@ Last week, I received an email from Lets Encrypt reminding me to renew my cer
</ul>
</div>
<div class="page__footer-copyright">&copy; 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">© 2023 Şahin Akkaya's Personal Page. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
<div class="page__footer-copyright">
Check out the <a href="https://github.com/Asocia/sahinakkayadotdev">code</a> of this site.
</div>