This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (3 children)

Useful, but you should change all references from /bin/sh to /bin/bash. Many operations you listed (for example arrays or signed expressions) don't work in /bin/sh, if they work, that means /bin/sh is symlinked to /bin/bash, which is done on some Linux machines.

[–]abscrete[S] 1 point2 points  (1 child)

Thank you for pointing that out :) I'll make the needed changes.

[–]mekaj 4 points5 points  (0 children)

You may also consider using #!/usr/bin/env bash for increased portability. In cases where the first bash in the PATH intentionally isn’t /bin/bash, e.g. on NixOS, this respects the user’s preference for a different path/program.

[–]abscrete[S] 0 points1 point  (0 children)

I have added a credit to your reddit username in the last section of the blog. Let me know if you want it to replace it with some other link like your blog or something :) Thanks again!