diff options
author | johannst <johannst@users.noreply.github.com> | 2020-03-21 11:51:10 +0000 |
---|---|---|
committer | johannst <johannst@users.noreply.github.com> | 2020-03-21 11:51:10 +0000 |
commit | a3b9bee22eea30b8b8ffbf30a43c53c5742f834a (patch) | |
tree | 6920f73b7a7e93b1b5e763dee77027db4181b311 /print.html | |
parent | f7f091a2e6d3167fed4e1063dea266cdfff3ab55 (diff) | |
download | notes-a3b9bee22eea30b8b8ffbf30a43c53c5742f834a.tar.gz notes-a3b9bee22eea30b8b8ffbf30a43c53c5742f834a.zip |
deploy: cb747f51cbe63e1302192eaf029ebdd4f1e154c0
Diffstat (limited to 'print.html')
-rw-r--r-- | print.html | 51 |
1 files changed, 45 insertions, 6 deletions
@@ -1,5 +1,5 @@ <!DOCTYPE HTML> -<html lang="en" class="sidebar-visible no-js ayu"> +<html lang="en" class="sidebar-visible no-js light"> <head> <!-- Book generated using mdBook --> <meta charset="UTF-8"> @@ -38,7 +38,7 @@ <!-- Provide site root to javascript --> <script type="text/javascript"> var path_to_root = ""; - var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "ayu" : "ayu"; + var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "light" : "light"; </script> <!-- Work around some values being stored in localStorage wrapped in quotes --> @@ -64,7 +64,7 @@ if (theme === null || theme === undefined) { theme = default_theme; } var html = document.querySelector('html'); html.classList.remove('no-js') - html.classList.remove('ayu') + html.classList.remove('light') html.classList.add(theme); html.classList.add('js'); </script> @@ -83,7 +83,7 @@ <nav id="sidebar" class="sidebar" aria-label="Table of contents"> <div id="sidebar-scrollbox" class="sidebar-scrollbox"> - <ol class="chapter"><li class="expanded "><a href="ld.so.html"><strong aria-hidden="true">1.</strong> ld.so</a></li><li class="expanded "><a href="git.html"><strong aria-hidden="true">2.</strong> git</a></li><li class="expanded "><a href="tmux.html"><strong aria-hidden="true">3.</strong> tmux</a></li><li class="expanded "><a href="awk.html"><strong aria-hidden="true">4.</strong> awk</a></li><li class="expanded "><a href="gdb.html"><strong aria-hidden="true">5.</strong> gdb</a></li><li class="expanded "><a href="radare2.html"><strong aria-hidden="true">6.</strong> radare2</a></li><li class="expanded "><a href="emacs.html"><strong aria-hidden="true">7.</strong> emacs</a></li><li class="expanded "><a href="fish.html"><strong aria-hidden="true">8.</strong> fish</a></li><li class="expanded "><a href="strace.html"><strong aria-hidden="true">9.</strong> strace</a></li><li class="expanded "><a href="lsof.html"><strong aria-hidden="true">10.</strong> lsof</a></li><li class="expanded "><a href="pidstat.html"><strong aria-hidden="true">11.</strong> pidstat</a></li><li class="expanded "><a href="time.html"><strong aria-hidden="true">12.</strong> time</a></li><li class="expanded "><a href="pgrep.html"><strong aria-hidden="true">13.</strong> pgrep</a></li><li class="expanded "><a href="pstack.html"><strong aria-hidden="true">14.</strong> pstack</a></li><li class="expanded "><a href="perf.html"><strong aria-hidden="true">15.</strong> perf</a></li><li class="expanded "><a href="oprofile.html"><strong aria-hidden="true">16.</strong> OProfile</a></li><li class="expanded "><a href="od.html"><strong aria-hidden="true">17.</strong> od</a></li><li class="expanded "><a href="xxd.html"><strong aria-hidden="true">18.</strong> xxd</a></li><li class="expanded "><a href="readelf.html"><strong aria-hidden="true">19.</strong> readelf</a></li><li class="expanded "><a href="objdump.html"><strong aria-hidden="true">20.</strong> objdump</a></li><li class="expanded "><a href="nm.html"><strong aria-hidden="true">21.</strong> nm</a></li><li class="expanded "><a href="c++filt.html"><strong aria-hidden="true">22.</strong> c++filt</a></li><li class="expanded "><a href="c++.html"><strong aria-hidden="true">23.</strong> c++</a></li><li class="expanded "><a href="glibc.html"><strong aria-hidden="true">24.</strong> glibc</a></li><li class="expanded "><a href="gcc.html"><strong aria-hidden="true">25.</strong> gcc</a></li></ol> + <ol class="chapter"><li class="expanded "><a href="ld.so.html"><strong aria-hidden="true">1.</strong> ld.so</a></li><li class="expanded "><a href="git.html"><strong aria-hidden="true">2.</strong> git</a></li><li class="expanded "><a href="bash.html"><strong aria-hidden="true">3.</strong> bash</a></li><li class="expanded "><a href="tmux.html"><strong aria-hidden="true">4.</strong> tmux</a></li><li class="expanded "><a href="awk.html"><strong aria-hidden="true">5.</strong> awk</a></li><li class="expanded "><a href="gdb.html"><strong aria-hidden="true">6.</strong> gdb</a></li><li class="expanded "><a href="radare2.html"><strong aria-hidden="true">7.</strong> radare2</a></li><li class="expanded "><a href="emacs.html"><strong aria-hidden="true">8.</strong> emacs</a></li><li class="expanded "><a href="fish.html"><strong aria-hidden="true">9.</strong> fish</a></li><li class="expanded "><a href="strace.html"><strong aria-hidden="true">10.</strong> strace</a></li><li class="expanded "><a href="lsof.html"><strong aria-hidden="true">11.</strong> lsof</a></li><li class="expanded "><a href="pidstat.html"><strong aria-hidden="true">12.</strong> pidstat</a></li><li class="expanded "><a href="time.html"><strong aria-hidden="true">13.</strong> time</a></li><li class="expanded "><a href="pgrep.html"><strong aria-hidden="true">14.</strong> pgrep</a></li><li class="expanded "><a href="pstack.html"><strong aria-hidden="true">15.</strong> pstack</a></li><li class="expanded "><a href="perf.html"><strong aria-hidden="true">16.</strong> perf</a></li><li class="expanded "><a href="oprofile.html"><strong aria-hidden="true">17.</strong> OProfile</a></li><li class="expanded "><a href="od.html"><strong aria-hidden="true">18.</strong> od</a></li><li class="expanded "><a href="xxd.html"><strong aria-hidden="true">19.</strong> xxd</a></li><li class="expanded "><a href="readelf.html"><strong aria-hidden="true">20.</strong> readelf</a></li><li class="expanded "><a href="objdump.html"><strong aria-hidden="true">21.</strong> objdump</a></li><li class="expanded "><a href="nm.html"><strong aria-hidden="true">22.</strong> nm</a></li><li class="expanded "><a href="c++filt.html"><strong aria-hidden="true">23.</strong> c++filt</a></li><li class="expanded "><a href="c++.html"><strong aria-hidden="true">24.</strong> c++</a></li><li class="expanded "><a href="glibc.html"><strong aria-hidden="true">25.</strong> glibc</a></li><li class="expanded "><a href="gcc.html"><strong aria-hidden="true">26.</strong> gcc</a></li></ol> </div> <div id="sidebar-resize-handle" class="sidebar-resize-handle"></div> </nav> @@ -102,11 +102,11 @@ <i class="fa fa-paint-brush"></i> </button> <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu"> - <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li> + <li role="none"><button role="menuitem" class="theme" id="light">Light (default)</button></li> <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li> <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li> <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li> - <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu (default)</button></li> + <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li> </ul> <button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar"> @@ -366,6 +366,45 @@ As we can see the offset from relocation at index <code>0</code> points to <code difference between HEAD^ and HEAD~) git rev-list --max-parents=0 HEAD ........... first commit </code></pre> +<h1><a class="header" href="#bash1" id="bash1">bash(1)</a></h1> +<h2><a class="header" href="#expansion" id="expansion">Expansion</a></h2> +<h3><a class="header" href="#generator" id="generator">Generator</a></h3> +<pre><code class="language-bash"># generate sequence from n to m +{n..m} +# generate sequence from n to m step by s +{n..m..s} + +# expand cartesian product +{a,b}{c,d} +</code></pre> +<h3><a class="header" href="#parameter" id="parameter">Parameter</a></h3> +<pre><code class="language-bash"># default param +# if $foo set, then bar=$foo else bar=some_val +bar=${foo:-some_val} +</code></pre> +<h2><a class="header" href="#io-redirection" id="io-redirection">I/O redirection</a></h2> +<blockquote> +<p>Note: The trick with bash I/O redirection is to interpret from left-to-right.</p> +</blockquote> +<pre><code class="language-bash"># stdout & stderr to file +command >file 2>&1 +# equivalent +command &>file + +# stderr to stdout & stdout to file +command 2>&1 >file +</code></pre> +<h3><a class="header" href="#explanation" id="explanation">Explanation</a></h3> +<pre><code class="language-bash">j>&i +</code></pre> +<p>Duplicate <code>fd i</code> to <code>fd j</code>, making <code>j</code> a copy of <code>i</code>. See <a href="http://man7.org/linux/man-pages/man2/dup.2.html">dup2(2)</a>.</p> +<p>Example:</p> +<pre><code class="language-bash">command 2>&1 >file +</code></pre> +<ol> +<li>duplicate <code>fd 1</code> to <code>fd 2</code>, effectively redirecting <code>stderr</code> to <code>stdout</code></li> +<li>redirect <code>stdout</code> to <code>file</code></li> +</ol> <h1><a class="header" href="#tmux1" id="tmux1">tmux(1)</a></h1> <p>Terminology:</p> <ul> |