Skip to content

Commit 58432e1

Browse files
updated css
1 parent dd2b58d commit 58432e1

File tree

86 files changed

+86
-86
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+86
-86
lines changed

Diff for: 100-page-python-intro-book-announcement/index.html

+1-1
Large diffs are not rendered by default.

Diff for: a-short-and-satisfying-bug-hunt/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@
4040
</span><span style=color:#5597d6;>Not</span><span> fine
4141
</span><span style=color:#5597d6;>$ </span><span style=color:#72ab00;>[</span><span>[ </span><span style=color:#d07711;>'a[5]'</span><span> == </span><span style=color:#d07711;>'a[5]' </span><span style=color:#72ab00;>]</span><span>] </span><span style=color:#72ab00;>&& </span><span style=color:#b39f04;>echo </span><span style=color:#d07711;>'fine'
4242
</span><span style=color:#5597d6;>fine
43-
</span></code></pre><p>Having a minimal failing case from terminal was a relief. I tried <code>set -x</code> but that didn't light a bulb either. Finally, somehow I thought perhaps characters in the output was causing the issue and when <code>[]</code> characters were not present, the comparison worked as expected.<p>I did think quoting could be the issue, but dismissed it at first as both sides of comparison had the same command. Then my recent experience from reviewing <a href=https://www.packtpub.com/application-development/command-line-fundamentals>Command Line Fundamentals</a> book came in handy. I remembered that if quotes aren't used on RHS of comparison operator, it is treated as <code>glob</code> matching instead of string matching. Phew.<h2 id=tl-dr>TL;DR<a aria-label="Anchor link for: tl-dr" class=zola-anchor href=#tl-dr>🔗</a></h2><p>Always <a href=https://unix.stackexchange.com/questions/131766/why-does-my-shell-script-choke-on-whitespace-or-other-special-characters>quote strings in bash</a> unless you have a very good reason for not using them.<p>After adding double quotes around the command substitution commands, the script worked as expected. I thanked the user for opening the issue. And then informed the author for cli fundamentals book as well.</div><div class=post-footer><div class=post-tags><a href=https://learnbyexample.github.io/tags/shell-scripting/>#shell scripting</a><a href=https://learnbyexample.github.io/tags/debugging/>#debugging</a><a href=https://learnbyexample.github.io/tags/corner-case/>#corner case</a></div><hr color=#e6e6e6><div class=post-nav><a class=previous href=https://learnbyexample.github.io/python-for-maths/>← Python for maths</a></div><br><br><hr color=#e6e6e6><p>📰 Use <a href=https://learnbyexample.github.io/atom.xml>this link</a> for the Atom feed. <br> ✅ Follow me on <a href=https://twitter.com/learn_byexample>Twitter</a>, <a href=https://github.com/learnbyexample>GitHub</a> and <a href=https://www.youtube.com/c/learnbyexample42>Youtube</a> for interesting tech nuggets. <br> 📧 Subscribe to <a href=https://learnbyexample.gumroad.com/l/learnbyexample-weekly>learnbyexample weekly</a> for programming resources, tips, tools, free ebooks and more (free newsletter, delivered every Friday).<hr color=#e6e6e6></div></article></div></main></div><script src=https://learnbyexample.github.io/even.js></script>
43+
</span></code></pre><p>Having a minimal failing case from terminal was a relief. I tried <code>set -x</code> but that didn't light a bulb either. Finally, somehow I thought perhaps characters in the output was causing the issue and when <code>[]</code> characters were not present, the comparison worked as expected.<p>I did think quoting could be the issue, but dismissed it at first as both sides of comparison had the same command. Then my recent experience from reviewing <a href=https://www.packtpub.com/application-development/command-line-fundamentals>Command Line Fundamentals</a> book came in handy. I remembered that if quotes aren't used on RHS of comparison operator, it is treated as <code>glob</code> matching instead of string matching. Phew.<h2 id=tl-dr>TL;DR<a aria-label="Anchor link for: tl-dr" class=zola-anchor href=#tl-dr>🔗</a></h2><p>Always <a href=https://unix.stackexchange.com/questions/131766/why-does-my-shell-script-choke-on-whitespace-or-other-special-characters>quote strings in bash</a> unless you have a very good reason for not using them.<p>After adding double quotes around the command substitution commands, the script worked as expected. I thanked the user for opening the issue. And then informed the author for cli fundamentals book as well.</div><div class=post-footer><div class=post-tags><a href=https://learnbyexample.github.io/tags/shell-scripting/>#shell scripting</a><a href=https://learnbyexample.github.io/tags/debugging/>#debugging</a><a href=https://learnbyexample.github.io/tags/corner-case/>#corner case</a></div><hr color=#e6e6e6><div class=post-nav><p><a class=previous href=https://learnbyexample.github.io/python-for-maths/>← Python for maths</a><br></div><hr color=#e6e6e6><p>📰 Use <a href=https://learnbyexample.github.io/atom.xml>this link</a> for the Atom feed. <br> ✅ Follow me on <a href=https://twitter.com/learn_byexample>Twitter</a>, <a href=https://github.com/learnbyexample>GitHub</a> and <a href=https://www.youtube.com/c/learnbyexample42>Youtube</a> for interesting tech nuggets. <br> 📧 Subscribe to <a href=https://learnbyexample.gumroad.com/l/learnbyexample-weekly>learnbyexample weekly</a> for programming resources, tips, tools, free ebooks and more (free newsletter, delivered every Friday).<hr color=#e6e6e6></div></article></div></main></div><script src=https://learnbyexample.github.io/even.js></script>

Diff for: automating-excel-with-python-review/index.html

+1-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)