<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Linux - tagged #unix</title><link>https://kyselo.eu/linux</link><description>All about Linux kernel and operating systems that are based on it.[Random post]</description><item><title>(no title)</title><link>https://kyselo.eu/linux/post/30523</link><guid isPermaLink="true">https://kyselo.eu/linux/post/30523</guid><description>&lt;img src="https://kyselo.eu//pub/8d/15/73/8d1573081d36ce1f98ef70a41bffca8f.png"&gt;</description><enclosure url="https://kyselo.eu/pub/8d/15/73/8d1573081d36ce1f98ef70a41bffca8f.png" length="20439" type="image/png"/><pubDate>Fri, 30 Dec 2022 17:55:08 +0100</pubDate></item><item><title>Double dollar sign ($$) in bash</title><link>https://kyselo.eu/linux/post/25544</link><guid isPermaLink="true">https://kyselo.eu/linux/post/25544</guid><description>&lt;p&gt;It substitutes to PID of the current running shell. For example running&lt;br&gt;&lt;/p&gt;&lt;pre&gt;ps -Alf|grep $$&lt;/pre&gt;&lt;p&gt;generates interesting results, as shown below&lt;br&gt;&lt;/p&gt;&lt;pre&gt;$ ps -Alf|grep $$&lt;br&gt;0 S juozas&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11125&amp;nbsp;&amp;nbsp; 11120&amp;nbsp; 0&amp;nbsp; 80&amp;nbsp;&amp;nbsp; 0 -&amp;nbsp; 3391 do_wai 22:43 pts/0&amp;nbsp;&amp;nbsp;&amp;nbsp; 00:00:00 bash&lt;br&gt;4 R juozas&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11197&amp;nbsp;&amp;nbsp; 11125&amp;nbsp; 0&amp;nbsp; 80&amp;nbsp;&amp;nbsp; 0 -&amp;nbsp; 3506 -&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22:46 pts/0&amp;nbsp;&amp;nbsp;&amp;nbsp; 00:00:00 ps -Alf&lt;br&gt;0 S juozas&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11198&amp;nbsp;&amp;nbsp; 11125&amp;nbsp; 0&amp;nbsp; 80&amp;nbsp;&amp;nbsp; 0 -&amp;nbsp; 2859 pipe_w 22:46 pts/0&amp;nbsp;&amp;nbsp;&amp;nbsp; 00:00:00 grep --color=auto 11125&lt;br&gt;&lt;/pre&gt;&lt;p&gt;Another example is to use it in the file names where it gets substituted with the PID of the current running shell.&lt;br&gt;&lt;/p&gt;&lt;pre&gt;$ cat &amp;gt;f$$.txt &amp;lt;&amp;lt;EOF&lt;br&gt;This is a test. The pid of running shell is $$&lt;br&gt;EOF&lt;br&gt;$ cat f$$.txt&lt;br&gt;This is a test. The pid of running shell is 11125&lt;br&gt;$ ls f$$.txt&lt;br&gt;f11125.txt&lt;br&gt;$ LC_ALL=C rm -v f$$.txt&lt;br&gt;removed 'f11125.txt'&lt;br&gt;&lt;/pre&gt;</description><pubDate>Sat, 19 Feb 2022 21:50:31 +0100</pubDate></item></channel></rss>
