<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.antiperfect.org/index.php?action=history&amp;feed=atom&amp;title=Menu</id>
	<title>Menu - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.antiperfect.org/index.php?action=history&amp;feed=atom&amp;title=Menu"/>
	<link rel="alternate" type="text/html" href="https://wiki.antiperfect.org/index.php?title=Menu&amp;action=history"/>
	<updated>2026-10-18T01:15:09Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki.antiperfect.org/index.php?title=Menu&amp;diff=1258&amp;oldid=prev</id>
		<title>Hdridder at 09:41, 20 January 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.antiperfect.org/index.php?title=Menu&amp;diff=1258&amp;oldid=prev"/>
		<updated>2022-01-20T09:41:17Z</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 09:41, 20 January 2022&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-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&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;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Bash]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&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;[[Category:Linux/Unix]]&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;[[Category:Linux/Unix]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&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;&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;div&gt;Super simple bash menu ([https://bash.cyberciti.biz/guide/Menu_driven_scripts inspiration])&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;Super simple bash menu ([https://bash.cyberciti.biz/guide/Menu_driven_scripts inspiration])&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;div&gt;&amp;lt;syntaxhighlight lang=bash&amp;gt;&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;&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki-i3a:diff:1.41:old-935:rev-1258:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Hdridder</name></author>
	</entry>
	<entry>
		<id>https://wiki.antiperfect.org/index.php?title=Menu&amp;diff=935&amp;oldid=prev</id>
		<title>Hdridder: Created page with &quot;Category:Bash Category:Linux/Unix Super simple bash menu ([https://bash.cyberciti.biz/guide/Menu_driven_scripts inspiration]) &lt;syntaxhighlight lang=bash&gt; #!/bin/bash #...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.antiperfect.org/index.php?title=Menu&amp;diff=935&amp;oldid=prev"/>
		<updated>2020-08-28T17:59:14Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/index.php?title=Category:Bash&quot; class=&quot;mw-redirect&quot; title=&quot;Category:Bash&quot;&gt;Category:Bash&lt;/a&gt; &lt;a href=&quot;/index.php?title=Category:Linux/Unix&quot; title=&quot;Category:Linux/Unix&quot;&gt;Category:Linux/Unix&lt;/a&gt; Super simple bash menu ([https://bash.cyberciti.biz/guide/Menu_driven_scripts inspiration]) &amp;lt;syntaxhighlight lang=bash&amp;gt; #!/bin/bash #...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Bash]]&lt;br /&gt;
[[Category:Linux/Unix]]&lt;br /&gt;
Super simple bash menu ([https://bash.cyberciti.biz/guide/Menu_driven_scripts inspiration])&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# Super simple bash menu &lt;br /&gt;
## ----------------------------------&lt;br /&gt;
# Step #1: Define variables&lt;br /&gt;
# ----------------------------------&lt;br /&gt;
RED=&amp;#039;\033[0;41;30m&amp;#039;&lt;br /&gt;
STD=&amp;#039;\033[0;0;39m&amp;#039;&lt;br /&gt;
 &lt;br /&gt;
# ----------------------------------&lt;br /&gt;
# Step #2: User defined function&lt;br /&gt;
# ----------------------------------&lt;br /&gt;
pause(){&lt;br /&gt;
  read -p &amp;quot;Press [Enter] key to continue...&amp;quot; fackEnterKey&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
one(){&lt;br /&gt;
  echo &amp;quot;one() called&amp;quot;&lt;br /&gt;
  pause&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
# do something in two()&lt;br /&gt;
two(){&lt;br /&gt;
  echo &amp;quot;two() called&amp;quot;&lt;br /&gt;
  pause&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
# function to display menus&lt;br /&gt;
show_menus() {&lt;br /&gt;
  clear&lt;br /&gt;
  echo &amp;quot;~~~~~~~~~~~~~~~~~~~~~&amp;quot;	&lt;br /&gt;
  echo &amp;quot; M A I N - M E N U&amp;quot;&lt;br /&gt;
  echo &amp;quot;~~~~~~~~~~~~~~~~~~~~~&amp;quot;&lt;br /&gt;
  echo &amp;quot;1. do one &amp;quot;&lt;br /&gt;
  echo &amp;quot;2. do two&amp;quot;&lt;br /&gt;
  echo &amp;quot;3. do three&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  echo &amp;quot;9. Exit&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
# read input from the keyboard and take a action&lt;br /&gt;
#  call a function defined above or a script anywhere on your system&lt;br /&gt;
read_options(){&lt;br /&gt;
    local choice&lt;br /&gt;
    read -p &amp;quot;Enter choice [ 1 - 3] &amp;quot; choice&lt;br /&gt;
    case $choice in&lt;br /&gt;
        1) one ;;&lt;br /&gt;
	2) two ;;&lt;br /&gt;
	3) &amp;lt;pathtoacommand&amp;gt;&lt;br /&gt;
           pause ;;&lt;br /&gt;
	9) exit 0;;&lt;br /&gt;
	*) echo -e &amp;quot;${RED}Error...${STD}&amp;quot; &amp;amp;&amp;amp; sleep 2&lt;br /&gt;
    esac&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
# ----------------------------------------------&lt;br /&gt;
# Step #3: Trap CTRL+C, CTRL+Z and quit singles&lt;br /&gt;
# ----------------------------------------------&lt;br /&gt;
trap &amp;#039;&amp;#039; SIGINT SIGQUIT SIGTSTP&lt;br /&gt;
 &lt;br /&gt;
# -----------------------------------&lt;br /&gt;
# Step #4: Main logic - infinite loop&lt;br /&gt;
# ------------------------------------&lt;br /&gt;
while true&lt;br /&gt;
do&lt;br /&gt;
  show_menus&lt;br /&gt;
  read_options&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hdridder</name></author>
	</entry>
</feed>