diff options
Diffstat (limited to 'src/docs/Shell-Conventions.html')
-rw-r--r-- | src/docs/Shell-Conventions.html | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/docs/Shell-Conventions.html b/src/docs/Shell-Conventions.html index cb040d0..dd841de 100644 --- a/src/docs/Shell-Conventions.html +++ b/src/docs/Shell-Conventions.html @@ -7,7 +7,8 @@ under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free -Documentation License." --> +Documentation License." + --> <!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> @@ -22,7 +23,7 @@ Documentation License." --> <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> <link href="Conventions.html" rel="up" title="Conventions"> <link href="Repository-Conventions.html" rel="next" title="Repository Conventions"> -<link href="General-Conventions.html" rel="prev" title="General Conventions"> +<link href="Conventions.html" rel="prev" title="Conventions"> <style type="text/css"> <!-- a.summary-letter {text-decoration: none} @@ -48,57 +49,56 @@ ul.no-bullet {list-style: none} <body lang="en"> <span id="Shell-Conventions"></span><div class="header"> <p> -Next: <a href="Repository-Conventions.html" accesskey="n" rel="next">Repository Conventions</a>, Previous: <a href="General-Conventions.html" accesskey="p" rel="prev">General Conventions</a>, Up: <a href="Conventions.html" accesskey="u" rel="up">Conventions</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p> +Next: <a href="Repository-Conventions.html" accesskey="n" rel="next">Repository Conventions</a>, Up: <a href="Conventions.html" accesskey="u" rel="up">Conventions</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p> </div> <hr> -<span id="Shell-Conventions-_002d_002d-10"></span><h4 class="subsection">4.1.2 Shell Conventions – 10</h4> +<span id="Shell-Conventions-1"></span><h4 class="subsection">3.1.1 Shell Conventions</h4> <p>Shell is central to Carbs Linux projects. Most of the tools and packages are written in POSIX sh. </p> <dl compact="compact"> -<dt><strong>[<span id="g_t1010"></span>1010]</strong></dt> +<dt>[<span id="g_t1010"></span>1010]</dt> <dd><p>Use 4 spaces for indentation, don’t use tabs. </p></dd> -<dt><strong>[<span id="g_t1020"></span>1020]</strong></dt> +<dt>[<span id="g_t1020"></span>1020]</dt> <dd><p>Make sure you don’t use bash-specific code. </p></dd> -<dt><strong>[<span id="g_t1030"></span>1030]</strong></dt> -<dd><p>Make sure you lint your code with <code>shellcheck</code> and if you are new to -POSIX sh, use <code>checkbashisms</code>. +<dt>[<span id="g_t1030"></span>1030]</dt> +<dd><p>Make sure you lint your code with ‘<samp>shellcheck</samp>’ and if +you are new to POSIX sh, use ‘<samp>checkbashisms</samp>’. </p></dd> -<dt><strong>[<span id="g_t1040"></span>1040]</strong></dt> -<dd><p>Don’t spawn new processes if you don’t absolutely need to, especially during -string manipulation. +<dt>[<span id="g_t1040"></span>1040]</dt> +<dd><p>Don’t spawn new processes if you don’t absolutely need +to, especially during string manipulation. </p><dl compact="compact"> -<dt><strong>[<span id="g_t1041"></span>1041]</strong></dt> -<dd><p>Never use a program for text manupilation that isn’t defined in the POSIX -standard. This includes <code>gawk</code> and <code>perl</code>. +<dt>[<span id="g_t1041"></span>1041]</dt> +<dd><p>Never use a program for text manupilation that isn’t +defined in the POSIX standard. This includes ‘<samp>gawk</samp>’ and ‘<samp>perl</samp>’. </p></dd> -<dt><strong>[<span id="g_t1042"></span>1042]</strong></dt> +<dt>[<span id="g_t1042"></span>1042]</dt> <dd><p>Instead of <code>$(basename $file)</code>, use <code>${file##*}</code>. </p></dd> -<dt><strong>[<span id="g_t1043"></span>1043]</strong></dt> +<dt>[<span id="g_t1043"></span>1043]</dt> <dd><p>Instead of <code>$(dirname $file)</code>, use <code>${file%/*}</code>. </p></dd> </dl> + <div class="example"> -<pre class="example"># This is the same thing as <code>basename /path/to/test.asc .asc</code> +<pre class="example"># This is the same thing as basename /path/to/test.asc .asc $ file=/path/to/test.asc file=${file##*/} file=${file%.asc} $ echo $file test </pre></div> </dd> -<dt><strong>[<span id="g_t1050"></span>1050]</strong></dt> -<dd><p>Instead of backticks, use <tt>$(..)</tt>. +<dt>[<span id="g_t1050"></span>1050]</dt> +<dd><p>Instead of backticks, use <code>$(..)</code>. </p></dd> </dl> - - </body> </html> |