Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update demo database so Bash pages have correct code blocks #4116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AndrewPluzhnikov
Copy link
Contributor

Here are the diffs between the original and updated demo.zip:

diff -ru "trilium-demo-original/Trilium Demo/Tech/Linux/Bash scripting/Bash startup modes.html" "trilium-demo-src/Trilium Demo/Tech/Linux/Bash scripting/Bash startup modes.html"
--- "trilium-demo-original/Trilium Demo/Tech/Linux/Bash scripting/Bash startup modes.html"      2023-02-17 22:24:36.000000000 -0800
+++ "trilium-demo-src/Trilium Demo/Tech/Linux/Bash scripting/Bash startup modes.html"   2023-07-23 15:03:13.609475900 -0700
@@ -15,88 +15,73 @@
          <h3>Login shell</h3>

         <p>As a "login shell", Bash reads and sets (executes) the user's profile
-          from /etc/profile and one of ~/.bash_profile, ~/.bash_login, or ~/.profile
-          (in that order, using the first one that's readable!).</p>
-        <p>When a login shell exits, Bash reads and executes commands from the file
-          ~/.bash_logout, if it exists.</p>
+          from <code>/etc/profile</code> and one of <code>~/.bash_profile</code>, <code>~/.bash_login</code>,
+          or <code>~/.profile</code> (in that order, using the first one that's readable!).</p>
+        <p>When a login shell exits, Bash reads and executes commands from the file <code>~/.bash_logout</code>,
+          if it exists.</p>
         <p>Why an extra login shell mode? There are many actions and variable sets
           that only make sense for the initial user login. That's why all UNIX® shells
           have (should have) a "login" mode.</p>
         <p><i><strong>Methods to start Bash as a login shell:</strong></i>
-
         </p>
         <ul>
-          <li>the first character of argv[0] is - (a hyphen): traditional UNIX® shells
-            start from the login binary</li>
-          <li>Bash is started with the -l option</li>
-          <li>Bash is started with the --login option</li>
+          <li>the first character of <code>argv[0]</code> is - (a hyphen): traditional
+            UNIX® shells start from the login binary</li>
+          <li>Bash is started with the <code>-l</code> option</li>
+          <li>Bash is started with the <code>--login</code> option</li>
         </ul>
         <p><i><strong>Methods to test for login shell mode:</strong></i>
-
         </p>
         <ul>
           <li>the shell option <a href="http://wiki.bash-hackers.org/internals/shell_options#login_shell">login_shell</a> is
             set</li>
         </ul>
         <p><i><strong>Related switches:</strong></i>
-
         </p>
         <ul>
-          <li>--noprofile disables reading of all profile files</li>
+          <li><code>--noprofile</code> disables reading of all profile files</li>
         </ul>
-
-<h3>Interactive shell</h3>
-
+        <h3>Interactive shell</h3>
         <p>When Bash starts as an interactive non-login shell, it reads and executes
-          commands from ~/.bashrc. This file should contain, for example, aliases,
-          since they need to be defined in every shell as they're not inherited from
-          the parent shell.</p>
-        <p>The feature to have a system-wide /etc/bash.bashrc or a similar system-wide
-          rc-file is specific to vendors and distributors that ship <i>their own, patched variant of Bash</i>.
-          The classic way to have a system-wide rc file is to source /etc/bashrc
-          from every user's ~/.bashrc.</p>
+          commands from <code>~/.bashrc</code>. This file should contain, for example,
+          aliases, since they need to be defined in every shell as they're not inherited
+          from the parent shell.</p>
+        <p>The feature to have a system-wide <code>/etc/bash.bashrc</code> or a similar
+          system-wide rc-file is specific to vendors and distributors that ship <i>their own, patched variant of Bash</i>.
+          The classic way to have a system-wide rc file is to source <code>/etc/bashrc</code> from
+          every user's <code>~/.bashrc</code>.</p>
         <p><i><strong>Methods to test for interactive-shell mode:</strong></i>
-
         </p>
         <ul>
-          <li>the special parameter $- contains the letter i (lowercase I)</li>
+          <li>the special parameter <code>$</code>- contains the letter <code>i</code> (lowercase
+            I)</li>
         </ul>
         <p><i><strong>Related switches:</strong></i>
-
         </p>
         <ul>
-          <li>-i forces the interactive mode</li>
-          <li>--norc disables reading of the startup files (e.g. /etc/bash.bashrc if
-            supported) and ~/.bashrc</li>
-          <li>--rcfile defines another startup file (instead of /etc/bash.bashrc and
-            ~/.bashrc)</li>
+          <li><code>-i</code> forces the interactive mode</li>
+          <li><code>--norc</code> disables reading of the startup files (e.g. <code>/etc/bash.bashrc</code> if
+            supported) and <code>~/.bashrc</code>
+          </li>
+          <li><code>--rcfile</code> defines another startup file (instead of <code>/etc/bash.bashrc</code> and <code>~/.bashrc</code>)</li>
         </ul>
-
-<h3>SH mode</h3>
-
-        <p>When Bash starts in SH compatiblity mode, it tries to mimic the startup
+        <h3>SH mode</h3>
+        <p>When Bash starts in SH compatibility mode, it tries to mimic the startup
           behaviour of historical versions of sh as closely as possible, while conforming
-          to the POSIX® standard as well. The profile files read are /etc/profile
-          and ~/.profile, if it's a login shell.</p>
+          to the POSIX® standard as well. The profile files read are <code>/etc/profile</code> and <code>~/.profile</code>,
+          if it's a login shell.</p>
         <p>If it's not a login shell, the environment variable <a href="http://wiki.bash-hackers.org/syntax/shellvars#env">ENV</a> is
           evaluated and the resulting filename is used as the name of the startup
           file.</p>
         <p>After the startup files are read, Bash enters the <a href="http://wiki.bash-hackers.org/scripting/bashbehaviour#posix_run_mode">POSIX(r) compatiblity mode (for running, not for starting!)</a>.</p>
         <p><i><strong>Bash starts in sh compatiblity mode when:</strong></i>
-
         </p>
         <ul>
-          <li>the base filename in argv[0] is sh (
-            <figure class="image">
-              <img />
-            </figure> NB: /bin/sh may be linked to /bin/bash, but that doesn't mean it acts
-            like /bin/bash 
-            <figure class="image">
-              <img />
-            </figure>)</li>
+          <li>the base filename in <code>argv[0]</code> is <code>sh</code> (NB: <code>/bin/sh</code> may
+            be linked to <code>/bin/bash</code>, but that doesn't mean it acts like <code>/bin/bash</code>)</li>
         </ul>
       </div>
     </div>
   </body>

-</html>
\ No newline at end of file
+</html>
diff -ru "trilium-demo-original/Trilium Demo/Tech/Linux/Bash scripting/While loop.html" "trilium-demo-src/Trilium Demo/Tech/Linux/Bash scripting/While loop.html"
--- "trilium-demo-original/Trilium Demo/Tech/Linux/Bash scripting/While loop.html"      2023-02-17 22:24:36.000000000 -0800
+++ "trilium-demo-src/Trilium Demo/Tech/Linux/Bash scripting/While loop.html"   2023-07-23 14:58:51.289512900 -0700
@@ -14,19 +14,17 @@
       <div class="ck-content">
         <p>Documentation: <a href="http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_09_02.html">http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_09_02.html</a>

-        </p>
-        <p> </p>
-        <p>#!/bin/bash</p>
-        <p># This script opens 4 terminal windows.</p>
-        <p> </p>
-        <p>i="0"</p>
-        <p>while [ $i -lt 4 ]</p>
-        <p>do</p>
-        <p>    xterm &amp;</p>
-        <p>    i=$[$i+1]</p>
-        <p>done</p>
-      </div>
+       <pre><code class="language-text-plain">#!/bin/bash
+# This script opens 4 terminal windows.
+
+i="0"
+while [ $i -lt 4 ]
+do
+    xterm &amp;
+    i=$[$i+1]
+done</code></pre>
+     </div>
     </div>
   </body>

-</html>
\ No newline at end of file
+</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant