Thursday, 14 March 2019

On Rewriting Software

I came across the reference1 below on "rewriting" software, and it struck a cord with me.

Turns out that, as is so often the case, the fact where "you should never ever do that"2 has its successful exceptions.

References

[1] Lessons from 6 software rewrite stories
https://medium.com/@herbcaudill/lessons-from-6-software-rewrite-stories-635e4c8f7c22
[2] Joel Spolsky - Things You Should Never Do, Part I
https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/

Thursday, 7 March 2019

Adventures in Shell Scripts

A very simple and short blogpost today, sorries.

A colleague decided to automated some simple task by means of a shell script.

This script caused the following error:

rm: cannot remove 'tmp/*': No such file or directory

I quite quickly (after adding -f to defeat the are-you-sure-prompt) found out that double quotes indicated that it should take stuff literally. In this case the script was trying to actually delete the file tmp/*, and not finding it.

The shell did not expand the * properly when encased in double quotes.

A simple example for you to try if this is the case in your environment would be:

echo *

Instead of

echo "*"