Functions in Bash

Posted on Dec 04, 2019 in Computer Science • Tagged with programming, Bash, functions

Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.

Fish Shell is preferred to Bash/Zsh. The following content is for Bash/Zsh only.

By default, variables defined in a function are global, i.e., they are visible outside the function too.


Loops in Bash

Posted on Dec 03, 2019 in Computer Science • Tagged with programming, Bash, loop

Things under legendu.net/outdated are outdated technologies that the author does not plan to update any more. Please look for better alternatives.

Fish Shell is preferred to Bash/Zsh. The following content is for Bash/Zsh only.

Tips and Traps

  1. Forggeting $ is a common mistake when using a shell variable.