<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.johnlradford.io/index.php?action=history&amp;feed=atom&amp;title=Inotifywait_Shenanigans</id>
	<title>Inotifywait Shenanigans - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.johnlradford.io/index.php?action=history&amp;feed=atom&amp;title=Inotifywait_Shenanigans"/>
	<link rel="alternate" type="text/html" href="https://wiki.johnlradford.io/index.php?title=Inotifywait_Shenanigans&amp;action=history"/>
	<updated>2026-05-05T15:04:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.johnlradford.io/index.php?title=Inotifywait_Shenanigans&amp;diff=37&amp;oldid=prev</id>
		<title>Admin: /* Exec on Cat */</title>
		<link rel="alternate" type="text/html" href="https://wiki.johnlradford.io/index.php?title=Inotifywait_Shenanigans&amp;diff=37&amp;oldid=prev"/>
		<updated>2023-12-02T05:34:11Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Exec on Cat&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:34, 2 December 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l52&quot;&gt;Line 52:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 52:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Well now you might say &amp;quot;interesting but what good is that?&amp;quot; Well with a slight modification we can set a bit of a trap.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Well now you might say &amp;quot;interesting but what good is that?&amp;quot; Well with a slight modification we can set a bit of a trap.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Exec on Cat ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Exec on Cat &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; 👨‍💼/🐱 &lt;/ins&gt;===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Term 1: Set Tripwire&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Term 1: Set Tripwire&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://wiki.johnlradford.io/index.php?title=Inotifywait_Shenanigans&amp;diff=36&amp;oldid=prev</id>
		<title>Admin at 03:06, 2 December 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.johnlradford.io/index.php?title=Inotifywait_Shenanigans&amp;diff=36&amp;oldid=prev"/>
		<updated>2023-12-02T03:06:09Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 03:06, 2 December 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l56&quot;&gt;Line 56:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 56:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Term 1: Set Tripwire&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Term 1: Set Tripwire&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  » inotifywait -qqe open fart.txt&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  » inotifywait -qqe open fart.txt &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;&amp;amp; ./run_hax.sh&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Term 2: Harmlessly Cat a File&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Term 2: Harmlessly Cat a File&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://wiki.johnlradford.io/index.php?title=Inotifywait_Shenanigans&amp;diff=35&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;== Inotifywait ==  === Description ===  From the [https://linux.die.net/man/1/inotifywait man page].  &lt;pre&gt; NAME        inotifywait, fsnotifywait - wait for changes to files using inotify or fanotify  DESCRIPTION        inotifywait  efficiently waits for changes to files using Linux&#039;s inotify(7) interface.  It is        suitable for waiting for changes to files from shell scripts.  It  can  either  exit  once  an        event occurs, or continually execute and output eve...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.johnlradford.io/index.php?title=Inotifywait_Shenanigans&amp;diff=35&amp;oldid=prev"/>
		<updated>2023-12-02T03:04:39Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Inotifywait ==  === Description ===  From the [https://linux.die.net/man/1/inotifywait man page].  &amp;lt;pre&amp;gt; NAME        inotifywait, fsnotifywait - wait for changes to files using inotify or fanotify  DESCRIPTION        inotifywait  efficiently waits for changes to files using Linux&amp;#039;s inotify(7) interface.  It is        suitable for waiting for changes to files from shell scripts.  It  can  either  exit  once  an        event occurs, or continually execute and output eve...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Inotifywait ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
From the [https://linux.die.net/man/1/inotifywait man page].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
NAME&lt;br /&gt;
       inotifywait, fsnotifywait - wait for changes to files using inotify or fanotify&lt;br /&gt;
&lt;br /&gt;
DESCRIPTION&lt;br /&gt;
       inotifywait  efficiently waits for changes to files using Linux&amp;#039;s inotify(7) interface.  It is&lt;br /&gt;
       suitable for waiting for changes to files from shell scripts.  It  can  either  exit  once  an&lt;br /&gt;
       event occurs, or continually execute and output events as they occur.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Cat on Write ===&lt;br /&gt;
&lt;br /&gt;
* Term 1: inotifywait listener&lt;br /&gt;
&lt;br /&gt;
 » notifywait -qqe close_write fart.txt &amp;amp;&amp;amp; cat fart.txt&lt;br /&gt;
&lt;br /&gt;
Args are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
       -e &amp;lt;event&amp;gt;, --event &amp;lt;event&amp;gt;&lt;br /&gt;
              Listen  for specific event(s) only.  The events which can be listened for are listed in&lt;br /&gt;
              the EVENTS section.  This option can be specified more  than  once.   If  omitted,  all&lt;br /&gt;
              events are listened for.&lt;br /&gt;
&lt;br /&gt;
        -q, --quiet&lt;br /&gt;
              If specified once, the program will be less verbose.  Specifically, it will  not  state&lt;br /&gt;
              when it has completed establishing all inotify watches.&lt;br /&gt;
&lt;br /&gt;
              If specified twice, the program will output nothing at all, except in the case of fatal&lt;br /&gt;
              errors.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://linux.die.net/man/1/inotifywait Man inotifywait]&lt;br /&gt;
&lt;br /&gt;
* Term 2: Write to fart.txt&lt;br /&gt;
&lt;br /&gt;
 » echo fart fart fart &amp;gt; fart.txt&lt;br /&gt;
&lt;br /&gt;
* Term 1: fart.txt catt&amp;#039;ed&lt;br /&gt;
&lt;br /&gt;
 » notifywait -qqe close_write fart.txt &amp;amp;&amp;amp; cat fart.txt&lt;br /&gt;
 fart fart fart&lt;br /&gt;
&lt;br /&gt;
Well now you might say &amp;quot;interesting but what good is that?&amp;quot; Well with a slight modification we can set a bit of a trap.&lt;br /&gt;
&lt;br /&gt;
=== Exec on Cat ===&lt;br /&gt;
&lt;br /&gt;
* Term 1: Set Tripwire&lt;br /&gt;
&lt;br /&gt;
 » inotifywait -qqe open fart.txt&lt;br /&gt;
&lt;br /&gt;
* Term 2: Harmlessly Cat a File&lt;br /&gt;
 » cat fart.txt&lt;br /&gt;
&lt;br /&gt;
* Term 1: Hax Triggered!&lt;br /&gt;
 » inotifywait -qqe open fart.txt &amp;amp;&amp;amp; ./run_hax.sh&lt;br /&gt;
 Running Hax...&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
&lt;br /&gt;
https://superuser.com/questions/181517/how-to-execute-a-command-whenever-a-file-changes&lt;br /&gt;
&lt;br /&gt;
https://linux.die.net/man/1/inotifywait&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>