diff options
| author | Paul Buetow <git@mx.buetow.org> | 2021-05-15 18:38:09 +0100 |
|---|---|---|
| committer | Paul Buetow <git@mx.buetow.org> | 2021-05-21 05:11:05 +0100 |
| commit | aaea51bbbee9d3f1e2719e4186e28a1193c03789 (patch) | |
| tree | b9d987f98d070b0d17f84d406f56d53083fe372c | |
| parent | 5c95039b5b4a93631977d9260a3e6f1e2c899c57 (diff) | |
some typos
13 files changed, 182 insertions, 22 deletions
diff --git a/content/gemtext/gemfeed/2010-04-09-standard-ml-and-haskell.gmi b/content/gemtext/gemfeed/2010-04-09-standard-ml-and-haskell.gmi index 3d1411f7..a4a1dc57 100644 --- a/content/gemtext/gemfeed/2010-04-09-standard-ml-and-haskell.gmi +++ b/content/gemtext/gemfeed/2010-04-09-standard-ml-and-haskell.gmi @@ -4,7 +4,7 @@ I am currently looking into the functional programming language Standard ML (aka SML). The purpose is to refresh my functional programming skills and to learn something new too. Since I already know a little Haskell, could I do not help myself and I implemented the same exercises in Haskell too. -As you will see, SML and Haskell are very similar (at least when it comes to the basics). However, the syntax of Haskell is little bit more "advanced". Haskell utilises fewer keywords (e.g. no val, end, fun, fn ...). Haskell also allows to explicitly write down the function types. What I have been missing in SML so far is the so-called pattern guards. Although this is a very superficial comparison for now, so far I like Haskell more than SML. Nevertheless, I thought it would be fun to demonstrate a few simple functions of both languages to show off the similarities. +As you will see, SML and Haskell are very similar (at least when it comes to the basics). However, the syntax of Haskell is a bit more "advanced". Haskell utilizes fewer keywords (e.g. no val, end, fun, fn ...). Haskell also allows to explicitly write down the function types. What I have been missing in SML so far is the so-called pattern guards. Although this is a very superficial comparison for now, so far I like Haskell more than SML. Nevertheless, I thought it would be fun to demonstrate a few simple functions of both languages to show off the similarities. Haskell is also a "pure functional" programming language, whereas SML also makes explicit use of imperative concepts. I am by far not a specialist in either of these languages but here are a few functions implemented in both, SML and Haskell: diff --git a/content/gemtext/gemfeed/2011-05-07-perl-daemon-service-framework.gmi b/content/gemtext/gemfeed/2011-05-07-perl-daemon-service-framework.gmi index d13ff600..addd8911 100644 --- a/content/gemtext/gemfeed/2011-05-07-perl-daemon-service-framework.gmi +++ b/content/gemtext/gemfeed/2011-05-07-perl-daemon-service-framework.gmi @@ -72,7 +72,7 @@ daemon.wd=./ ## Example -So lets start the daemon with a loop interval of 10 seconds: +So let's start the daemon with a loop interval of 10 seconds: ``` $ ./control keys | grep daemon.loopinterval @@ -138,7 +138,7 @@ sub do ($) { ### Your own module -Want to give it some better use? It's just a easy as: +Want to give it some better use? It's just as easy as: ``` cd ./lib/PerlDaemonModules/ @@ -148,7 +148,7 @@ Want to give it some better use? It's just a easy as: ./bin/perldaemon restart (or shortcurt ./control restart) ``` -Now watch `./log/perldaemon.log` closely. It is a good practise to test your modules in 'foreground mode' (see above how to do that). +Now watch `./log/perldaemon.log` closely. It is a good practice to test your modules in 'foreground mode' (see above how to do that). BTW: You can install as many modules within the same instance as desired. But they are run in sequential order (in future they can also run in parallel using several threads or processes). diff --git a/content/gemtext/gemfeed/2021-05-15-buetow.org.sh-One-Bash-script-to-rule-it-all.draft.gmi b/content/gemtext/gemfeed/2021-05-15-buetow.org.sh-one-bash-script-to-rule-it-all.draft.gmi index 858478aa..858478aa 100644 --- a/content/gemtext/gemfeed/2021-05-15-buetow.org.sh-One-Bash-script-to-rule-it-all.draft.gmi +++ b/content/gemtext/gemfeed/2021-05-15-buetow.org.sh-one-bash-script-to-rule-it-all.draft.gmi diff --git a/content/gemtext/gemfeed/atom.xml b/content/gemtext/gemfeed/atom.xml index 89cd5036..5f738cc1 100644 --- a/content/gemtext/gemfeed/atom.xml +++ b/content/gemtext/gemfeed/atom.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> - <updated>2021-05-14T23:00:11+01:00</updated> + <updated>2021-05-15T18:38:00+01:00</updated> <title>buetow.org feed</title> <subtitle>Having fun with computers!</subtitle> <link href="gemini://buetow.org/gemfeed/atom.xml" rel="self" /> @@ -749,7 +749,7 @@ daemon.alivefile=./run/perldaemon.alive daemon.wd=./ </pre> <h2>Example </h2> -<p>So lets start the daemon with a loop interval of 10 seconds:</p> +<p>So let's start the daemon with a loop interval of 10 seconds:</p> <pre> $ ./control keys | grep daemon.loopinterval daemon.loopinterval=1 @@ -804,7 +804,7 @@ sub do ($) { 1; </pre> <h3>Your own module</h3> -<p>Want to give it some better use? It's just a easy as:</p> +<p>Want to give it some better use? It's just as easy as:</p> <pre> cd ./lib/PerlDaemonModules/ cp ExampleModule.pm YourModule.pm @@ -812,7 +812,7 @@ sub do ($) { cd - ./bin/perldaemon restart (or shortcurt ./control restart) </pre> -<p>Now watch `./log/perldaemon.log` closely. It is a good practise to test your modules in 'foreground mode' (see above how to do that).</p> +<p>Now watch `./log/perldaemon.log` closely. It is a good practice to test your modules in 'foreground mode' (see above how to do that).</p> <p>BTW: You can install as many modules within the same instance as desired. But they are run in sequential order (in future they can also run in parallel using several threads or processes).</p> <h2>May the source be with you</h2> <p>You can find PerlDaemon (including the examples) at:</p> @@ -1251,7 +1251,7 @@ BB <h1>Standard ML and Haskell</h1> <p class="quote"><i>Written by Paul Buetow 2010-04-09</i></p> <p>I am currently looking into the functional programming language Standard ML (aka SML). The purpose is to refresh my functional programming skills and to learn something new too. Since I already know a little Haskell, could I do not help myself and I implemented the same exercises in Haskell too.</p> -<p>As you will see, SML and Haskell are very similar (at least when it comes to the basics). However, the syntax of Haskell is little bit more "advanced". Haskell utilises fewer keywords (e.g. no val, end, fun, fn ...). Haskell also allows to explicitly write down the function types. What I have been missing in SML so far is the so-called pattern guards. Although this is a very superficial comparison for now, so far I like Haskell more than SML. Nevertheless, I thought it would be fun to demonstrate a few simple functions of both languages to show off the similarities. </p> +<p>As you will see, SML and Haskell are very similar (at least when it comes to the basics). However, the syntax of Haskell is a bit more "advanced". Haskell utilizes fewer keywords (e.g. no val, end, fun, fn ...). Haskell also allows to explicitly write down the function types. What I have been missing in SML so far is the so-called pattern guards. Although this is a very superficial comparison for now, so far I like Haskell more than SML. Nevertheless, I thought it would be fun to demonstrate a few simple functions of both languages to show off the similarities. </p> <p>Haskell is also a "pure functional" programming language, whereas SML also makes explicit use of imperative concepts. I am by far not a specialist in either of these languages but here are a few functions implemented in both, SML and Haskell:</p> <h2>Defining a multi data type</h2> <p>Standard ML:</p> diff --git a/content/html/gemfeed/2010-04-09-standard-ml-and-haskell.html b/content/html/gemfeed/2010-04-09-standard-ml-and-haskell.html index cde7ddb8..d96fdf27 100644 --- a/content/html/gemfeed/2010-04-09-standard-ml-and-haskell.html +++ b/content/html/gemfeed/2010-04-09-standard-ml-and-haskell.html @@ -55,7 +55,7 @@ h2, h3 { <h1>Standard ML and Haskell</h1> <p class="quote"><i>Written by Paul Buetow 2010-04-09</i></p> <p>I am currently looking into the functional programming language Standard ML (aka SML). The purpose is to refresh my functional programming skills and to learn something new too. Since I already know a little Haskell, could I do not help myself and I implemented the same exercises in Haskell too.</p> -<p>As you will see, SML and Haskell are very similar (at least when it comes to the basics). However, the syntax of Haskell is little bit more "advanced". Haskell utilises fewer keywords (e.g. no val, end, fun, fn ...). Haskell also allows to explicitly write down the function types. What I have been missing in SML so far is the so-called pattern guards. Although this is a very superficial comparison for now, so far I like Haskell more than SML. Nevertheless, I thought it would be fun to demonstrate a few simple functions of both languages to show off the similarities. </p> +<p>As you will see, SML and Haskell are very similar (at least when it comes to the basics). However, the syntax of Haskell is a bit more "advanced". Haskell utilizes fewer keywords (e.g. no val, end, fun, fn ...). Haskell also allows to explicitly write down the function types. What I have been missing in SML so far is the so-called pattern guards. Although this is a very superficial comparison for now, so far I like Haskell more than SML. Nevertheless, I thought it would be fun to demonstrate a few simple functions of both languages to show off the similarities. </p> <p>Haskell is also a "pure functional" programming language, whereas SML also makes explicit use of imperative concepts. I am by far not a specialist in either of these languages but here are a few functions implemented in both, SML and Haskell:</p> <h2>Defining a multi data type</h2> <p>Standard ML:</p> diff --git a/content/html/gemfeed/2011-05-07-perl-daemon-service-framework.html b/content/html/gemfeed/2011-05-07-perl-daemon-service-framework.html index 379e4361..fd73746f 100644 --- a/content/html/gemfeed/2011-05-07-perl-daemon-service-framework.html +++ b/content/html/gemfeed/2011-05-07-perl-daemon-service-framework.html @@ -114,7 +114,7 @@ daemon.alivefile=./run/perldaemon.alive daemon.wd=./ </pre> <h2>Example </h2> -<p>So lets start the daemon with a loop interval of 10 seconds:</p> +<p>So let's start the daemon with a loop interval of 10 seconds:</p> <pre> $ ./control keys | grep daemon.loopinterval daemon.loopinterval=1 @@ -169,7 +169,7 @@ sub do ($) { 1; </pre> <h3>Your own module</h3> -<p>Want to give it some better use? It's just a easy as:</p> +<p>Want to give it some better use? It's just as easy as:</p> <pre> cd ./lib/PerlDaemonModules/ cp ExampleModule.pm YourModule.pm @@ -177,7 +177,7 @@ sub do ($) { cd - ./bin/perldaemon restart (or shortcurt ./control restart) </pre> -<p>Now watch `./log/perldaemon.log` closely. It is a good practise to test your modules in 'foreground mode' (see above how to do that).</p> +<p>Now watch `./log/perldaemon.log` closely. It is a good practice to test your modules in 'foreground mode' (see above how to do that).</p> <p>BTW: You can install as many modules within the same instance as desired. But they are run in sequential order (in future they can also run in parallel using several threads or processes).</p> <h2>May the source be with you</h2> <p>You can find PerlDaemon (including the examples) at:</p> diff --git a/content/html/gemfeed/2021-05-15-buetow.org.sh-One-Bash-script-to-rule-it-all.draft.html b/content/html/gemfeed/2021-05-15-buetow.org.sh-one-bash-script-to-rule-it-all.draft.html index 7d47bdd6..7d47bdd6 100644 --- a/content/html/gemfeed/2021-05-15-buetow.org.sh-One-Bash-script-to-rule-it-all.draft.html +++ b/content/html/gemfeed/2021-05-15-buetow.org.sh-one-bash-script-to-rule-it-all.draft.html diff --git a/content/html/gemfeed/2021-05-15-personal-bash-coding-style-guide.draft.html b/content/html/gemfeed/2021-05-15-personal-bash-coding-style-guide.draft.html new file mode 100644 index 00000000..44ad0784 --- /dev/null +++ b/content/html/gemfeed/2021-05-15-personal-bash-coding-style-guide.draft.html @@ -0,0 +1,93 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> +<title>Having fun with computers!</title> +<link rel="shortcut icon" type="image/gif" href="/favicon.ico" /> +<style type="text/css"> +body { + margin: auto; + max-width: 900px; + background-color: #FFFFEF; + border: 1px dashed #880000; + border-radius: 8px; + padding: 5px; +} +img { + display:block; + max-width: 80%; +} +p.quote:before { + content: " | "; + padding-left: 2px; +} +a.textlink:before { + content: " ⇒ "; + padding-left: 2px; +} +a.textlink { + text-decoration: none; + color: #FF0000; +} +a.textlink:hover { + text-decoration: underline; +} +i { + color: #FFA500; +} +pre { + background-color: #F1F8E9; + border: 1px dashed #BB0000; + border-radius: 8px; + padding: 5px; + font-family: "Lucida Console", "Courier New", monospace; +} +h1 { + text-align: center; + color: #880000; +} +h2, h3 { + color: #BB0000; +} +</style> +</head> +<body> +<h1>Personal Bash coding style guide</h1> +<pre> + .---------------------------. + /,--..---..---..---..---..--. `. + //___||___||___||___||___||___\_| + [j__ ######################## [_| + \============================| + .==| |"""||"""||"""||"""| |"""|| +/======"---""---""---""---"=| =|| +|____ []* ____ | ==|| +// \\ // \\ |===|| hjw +"\__/"---------------"\__/"-+---+' +</pre> +<p class="quote"><i>Written by Paul Buetow 2021-15-21</i></p> +<p>Lately, I have been polishing and writing a lot of Bash code. Not that I never wrote a lot of Bash, but now as I also looked through the "Google Shell Style Guide" I thought it is time to also write my thoughts on that. I agree to that guide in most, but not in all points. </p> +<a class="textlink" href="https://google.github.io/styleguide/shellguide.html">Gogle Shell Style Guide</a><br /> +<p>I also highly recommend to have a read through the "Advanced Bash-Scripting Guide" (which is not from Google but written by Mendel Cooper). I learn something new every time I have a look at it.</p> +<a class="textlink" href="https://tldp.org/LDP/abs/html/">Advanced Bash-Scripting Guide</a><br /> +<h2>My modifications</h2> +<p>These are my personal modifications of the Google Guide.</p> +<h3>2 space soft-tabs indentation</h3> +<p>I know there have been many tab and soft-tab wars on this planet. Google recommends to use 2 space soft-tabs. </p> +<p>My own reality is I don't really care if I use 2 or 4 space indentations. I agree however that tabs should not be used. I personally tend to use 4 space soft-tabs as that's currently how my personal Vim is configured for any programming languages. What matters most though is consistency within the same script/project.</p> +<p>Google also recommends to limit line length to 80 characters. For some people that seem's to be an ancient habit from the 80's, where all computer terminals couldn't display longer lines. But I think that the 80 character mark is still a good practise at least for shell scripts. For example I am often writing code on a Microsoft Go Tablet PC (running Linux of course) and it comes in very handy if the lines are not too long due to the relatively small display on the device.</p> +<p>I hit the 80 character line length quicker with the 4 spaces, but that makes me refactor the Bash code more aggressively which is actually a good thing. </p> +<h3>Breaking long pipes</h3> +<h3>Quoting your variables</h3> +<h3>Prefer internal over external commands</h3> +<h2>My additions</h2> +<h3>Use of 'yes' and 'no'</h3> +<h3>Non-evil alternative to variable assignments via eval</h3> +<h3>Prefer pipes over arrays for list processing</h3> +<h2>Learned</h2> +<h3>Strucking me</h3> +<h3>PIPESTATUS</h3> +<p>E-Mail me your thoughts at comments@mx.buetow.org!</p> +<a class="textlink" href="../">Go back to the main site</a><br /> +</body> +</html> diff --git a/content/html/gemfeed/atom.xml b/content/html/gemfeed/atom.xml index b351cf62..35a58e5a 100644 --- a/content/html/gemfeed/atom.xml +++ b/content/html/gemfeed/atom.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> - <updated>2021-05-14T23:00:11+01:00</updated> + <updated>2021-05-15T18:38:00+01:00</updated> <title>buetow.org feed</title> <subtitle>Having fun with computers!</subtitle> <link href="https://buetow.org/gemfeed/atom.xml" rel="self" /> @@ -749,7 +749,7 @@ daemon.alivefile=./run/perldaemon.alive daemon.wd=./ </pre> <h2>Example </h2> -<p>So lets start the daemon with a loop interval of 10 seconds:</p> +<p>So let's start the daemon with a loop interval of 10 seconds:</p> <pre> $ ./control keys | grep daemon.loopinterval daemon.loopinterval=1 @@ -804,7 +804,7 @@ sub do ($) { 1; </pre> <h3>Your own module</h3> -<p>Want to give it some better use? It's just a easy as:</p> +<p>Want to give it some better use? It's just as easy as:</p> <pre> cd ./lib/PerlDaemonModules/ cp ExampleModule.pm YourModule.pm @@ -812,7 +812,7 @@ sub do ($) { cd - ./bin/perldaemon restart (or shortcurt ./control restart) </pre> -<p>Now watch `./log/perldaemon.log` closely. It is a good practise to test your modules in 'foreground mode' (see above how to do that).</p> +<p>Now watch `./log/perldaemon.log` closely. It is a good practice to test your modules in 'foreground mode' (see above how to do that).</p> <p>BTW: You can install as many modules within the same instance as desired. But they are run in sequential order (in future they can also run in parallel using several threads or processes).</p> <h2>May the source be with you</h2> <p>You can find PerlDaemon (including the examples) at:</p> @@ -1251,7 +1251,7 @@ BB <h1>Standard ML and Haskell</h1> <p class="quote"><i>Written by Paul Buetow 2010-04-09</i></p> <p>I am currently looking into the functional programming language Standard ML (aka SML). The purpose is to refresh my functional programming skills and to learn something new too. Since I already know a little Haskell, could I do not help myself and I implemented the same exercises in Haskell too.</p> -<p>As you will see, SML and Haskell are very similar (at least when it comes to the basics). However, the syntax of Haskell is little bit more "advanced". Haskell utilises fewer keywords (e.g. no val, end, fun, fn ...). Haskell also allows to explicitly write down the function types. What I have been missing in SML so far is the so-called pattern guards. Although this is a very superficial comparison for now, so far I like Haskell more than SML. Nevertheless, I thought it would be fun to demonstrate a few simple functions of both languages to show off the similarities. </p> +<p>As you will see, SML and Haskell are very similar (at least when it comes to the basics). However, the syntax of Haskell is a bit more "advanced". Haskell utilizes fewer keywords (e.g. no val, end, fun, fn ...). Haskell also allows to explicitly write down the function types. What I have been missing in SML so far is the so-called pattern guards. Although this is a very superficial comparison for now, so far I like Haskell more than SML. Nevertheless, I thought it would be fun to demonstrate a few simple functions of both languages to show off the similarities. </p> <p>Haskell is also a "pure functional" programming language, whereas SML also makes explicit use of imperative concepts. I am by far not a specialist in either of these languages but here are a few functions implemented in both, SML and Haskell:</p> <h2>Defining a multi data type</h2> <p>Standard ML:</p> diff --git a/content/md/gemfeed/2010-04-09-standard-ml-and-haskell.md b/content/md/gemfeed/2010-04-09-standard-ml-and-haskell.md index f43ef55a..5b9b38d8 100644 --- a/content/md/gemfeed/2010-04-09-standard-ml-and-haskell.md +++ b/content/md/gemfeed/2010-04-09-standard-ml-and-haskell.md @@ -4,7 +4,7 @@ I am currently looking into the functional programming language Standard ML (aka SML). The purpose is to refresh my functional programming skills and to learn something new too. Since I already know a little Haskell, could I do not help myself and I implemented the same exercises in Haskell too. -As you will see, SML and Haskell are very similar (at least when it comes to the basics). However, the syntax of Haskell is little bit more "advanced". Haskell utilises fewer keywords (e.g. no val, end, fun, fn ...). Haskell also allows to explicitly write down the function types. What I have been missing in SML so far is the so-called pattern guards. Although this is a very superficial comparison for now, so far I like Haskell more than SML. Nevertheless, I thought it would be fun to demonstrate a few simple functions of both languages to show off the similarities. +As you will see, SML and Haskell are very similar (at least when it comes to the basics). However, the syntax of Haskell is a bit more "advanced". Haskell utilizes fewer keywords (e.g. no val, end, fun, fn ...). Haskell also allows to explicitly write down the function types. What I have been missing in SML so far is the so-called pattern guards. Although this is a very superficial comparison for now, so far I like Haskell more than SML. Nevertheless, I thought it would be fun to demonstrate a few simple functions of both languages to show off the similarities. Haskell is also a "pure functional" programming language, whereas SML also makes explicit use of imperative concepts. I am by far not a specialist in either of these languages but here are a few functions implemented in both, SML and Haskell: diff --git a/content/md/gemfeed/2011-05-07-perl-daemon-service-framework.md b/content/md/gemfeed/2011-05-07-perl-daemon-service-framework.md index e23c2b8c..e47f407c 100644 --- a/content/md/gemfeed/2011-05-07-perl-daemon-service-framework.md +++ b/content/md/gemfeed/2011-05-07-perl-daemon-service-framework.md @@ -72,7 +72,7 @@ daemon.wd=./ ## Example -So lets start the daemon with a loop interval of 10 seconds: +So let's start the daemon with a loop interval of 10 seconds: ``` $ ./control keys | grep daemon.loopinterval @@ -138,7 +138,7 @@ sub do ($) { ### Your own module -Want to give it some better use? It's just a easy as: +Want to give it some better use? It's just as easy as: ``` cd ./lib/PerlDaemonModules/ @@ -148,7 +148,7 @@ Want to give it some better use? It's just a easy as: ./bin/perldaemon restart (or shortcurt ./control restart) ``` -Now watch `./log/perldaemon.log` closely. It is a good practise to test your modules in 'foreground mode' (see above how to do that). +Now watch `./log/perldaemon.log` closely. It is a good practice to test your modules in 'foreground mode' (see above how to do that). BTW: You can install as many modules within the same instance as desired. But they are run in sequential order (in future they can also run in parallel using several threads or processes). diff --git a/content/md/gemfeed/2021-05-15-buetow.org.sh-One-Bash-script-to-rule-it-all.draft.md b/content/md/gemfeed/2021-05-15-buetow.org.sh-one-bash-script-to-rule-it-all.draft.md index e463d52d..e463d52d 100644 --- a/content/md/gemfeed/2021-05-15-buetow.org.sh-One-Bash-script-to-rule-it-all.draft.md +++ b/content/md/gemfeed/2021-05-15-buetow.org.sh-one-bash-script-to-rule-it-all.draft.md diff --git a/content/md/gemfeed/2021-05-15-personal-bash-coding-style-guide.draft.md b/content/md/gemfeed/2021-05-15-personal-bash-coding-style-guide.draft.md new file mode 100644 index 00000000..bd21e74b --- /dev/null +++ b/content/md/gemfeed/2021-05-15-personal-bash-coding-style-guide.draft.md @@ -0,0 +1,67 @@ +# Personal Bash coding style guide + +``` + .---------------------------. + /,--..---..---..---..---..--. `. + //___||___||___||___||___||___\_| + [j__ ######################## [_| + \============================| + .==| |"""||"""||"""||"""| |"""|| +/======"---""---""---""---"=| =|| +|____ []* ____ | ==|| +// \\ // \\ |===|| hjw +"\__/"---------------"\__/"-+---+' +``` + +> Written by Paul Buetow 2021-15-21 + +Lately, I have been polishing and writing a lot of Bash code. Not that I never wrote a lot of Bash, but now as I also looked through the "Google Shell Style Guide" I thought it is time to also write my thoughts on that. I agree to that guide in most, but not in all points. + +[Gogle Shell Style Guide](https://google.github.io/styleguide/shellguide.html) + +I also highly recommend to have a read through the "Advanced Bash-Scripting Guide" (which is not from Google but written by Mendel Cooper). I learn something new every time I have a look at it. + +[Advanced Bash-Scripting Guide](https://tldp.org/LDP/abs/html/) + +## My modifications + +These are my personal modifications of the Google Guide. + +### 2 space soft-tabs indentation + +I know there have been many tab and soft-tab wars on this planet. Google recommends to use 2 space soft-tabs. + +My own reality is I don't really care if I use 2 or 4 space indentations. I agree however that tabs should not be used. I personally tend to use 4 space soft-tabs as that's currently how my personal Vim is configured for any programming languages. What matters most though is consistency within the same script/project. + +Google also recommends to limit line length to 80 characters. For some people that seem's to be an ancient habit from the 80's, where all computer terminals couldn't display longer lines. But I think that the 80 character mark is still a good practise at least for shell scripts. For example I am often writing code on a Microsoft Go Tablet PC (running Linux of course) and it comes in very handy if the lines are not too long due to the relatively small display on the device. + +I hit the 80 character line length quicker with the 4 spaces, but that makes me refactor the Bash code more aggressively which is actually a good thing. + +### Breaking long pipes + +### Quoting your variables + +### Prefer internal over external commands + +## My additions + +### Use of 'yes' and 'no' + +### Non-evil alternative to variable assignments via eval + +### Prefer pipes over arrays for list processing + +## Learned + +### Strucking me + +### PIPESTATUS + + + + + + +E-Mail me your thoughts at comments@mx.buetow.org! + +[Go back to the main site](../) |
