This is documentation for the old, first-generation Kaa platform v0.x.
Next generation Kaa Enterprise IoT platform is now available! Try it free with a 30-days trial.
Kaa Enterprise documentation is here.
. . .

Shell

  • Prefer plain Bourne shell (sh) scripts when possible. Avoid using GNU Bash, ksh, or csh since they might be missing in a particular environment.
  • Use shebang at the first line of each shell script.

    #!/bin/sh
    
  • Use the shellcheck utility to validate correctness of shell scripts.
  • Use set -e to stop script execution when any command fails.
  • Use new line after conditional and loop statements for readability purposes.

    # Good
    if [ 1 -le 0 ]; then
      echo YES
    else
      echo NO
    fi
    
    # Bad
    if [ 1 -le 0 ]; then echo YES; else echo NO; fi