Skip to main content
deleted 198 characters in body
Source Link
l0b0
  • 9.1k
  • 22
  • 36

Specific suggestions:

  1. Function names are by convention snake_case.
  2. Use More Quotes™.
  3. [[ should be used instead of [, because it's safer.
  4. Use [[ -e PATH ]] to check for the existence of a path. So [ -z "$(ls -A ../logs_and_inputs)" ] should be ! [[ -e ../logs_and_inputs ]]. ls is not suitable for scripts (1, 2).
  5. [[ EXPRESSION ]] && [[ EXPRESSION ]] would be clearer than [[ EXPRESSION && EXPRESSION ]], in my opinion.
  6. set -o errexit -o noclobber -o nounset -o pipefail and shopt -s globfail would make the error handling much stricter.
  7. This is no longer trivial code, so I'd recommend implementing it in a non-shell language like Python.

Tool suggestions:

  1. Running shellcheck on your script regularly is a good way to capture possible issues. In this case the only thing it finds is for rm -r *x*x*:

    SC2035: Use ./glob or -- glob so names with dashes won't become options.

Specific suggestions:

  1. Function names are by convention snake_case.
  2. Use More Quotes™.
  3. [[ should be used instead of [, because it's safer.
  4. Use [[ -e PATH ]] to check for the existence of a path. So [ -z "$(ls -A ../logs_and_inputs)" ] should be ! [[ -e ../logs_and_inputs ]]. ls is not suitable for scripts (1, 2).
  5. [[ EXPRESSION ]] && [[ EXPRESSION ]] would be clearer than [[ EXPRESSION && EXPRESSION ]], in my opinion.
  6. set -o errexit -o noclobber -o nounset -o pipefail and shopt -s globfail would make the error handling much stricter.
  7. This is no longer trivial code, so I'd recommend implementing it in a non-shell language like Python.

Tool suggestions:

  1. Running shellcheck on your script regularly is a good way to capture possible issues. In this case the only thing it finds is for rm -r *x*x*:

    SC2035: Use ./glob or -- glob so names with dashes won't become options.

Specific suggestions:

  1. Function names are by convention snake_case.
  2. Use More Quotes™.
  3. [[ should be used instead of [, because it's safer.
  4. [[ EXPRESSION ]] && [[ EXPRESSION ]] would be clearer than [[ EXPRESSION && EXPRESSION ]], in my opinion.
  5. set -o errexit -o noclobber -o nounset -o pipefail and shopt -s globfail would make the error handling much stricter.
  6. This is no longer trivial code, so I'd recommend implementing it in a non-shell language like Python.

Tool suggestions:

  1. Running shellcheck on your script regularly is a good way to capture possible issues. In this case the only thing it finds is for rm -r *x*x*:

    SC2035: Use ./glob or -- glob so names with dashes won't become options.

added 85 characters in body
Source Link
l0b0
  • 9.1k
  • 22
  • 36

Specific suggestions:

  1. Function names are by convention snake_case.
  2. Use More Quotes™.
  3. [[ should be used instead of [, because it's safer.
  4. Use [[ -e PATH ]] to check for the existence of a path. So [ -z "$(ls -A ../logs_and_inputs)" ] should be ! [[ -e ../logs_and_inputs ]]. ls is not suitable for scripts (1, 2).
  5. [[ EXPRESSION ]] && [[ EXPRESSION ]] would be clearer than [[ EXPRESSION && EXPRESSION ]], in my opinion.
  6. set -o errexit -o noclobber -o nounset -o pipefail and shopt -s globfail would make the error handling much stricter.
  7. This is no longer trivial code, so I'd recommend implementing it in a non-shell language like Python.

Tool suggestions:

  1. Running shellcheck on your script regularly is a good way to capture possible issues. In this case the only thing it finds is for rm -r *x*x*:

    SC2035: Use ./glob or -- glob so names with dashes won't become options.

Specific suggestions:

  1. Function names are by convention snake_case.
  2. Use More Quotes™.
  3. [[ should be used instead of [, because it's safer.
  4. Use [[ -e PATH ]] to check for the existence of a path.
  5. [[ EXPRESSION ]] && [[ EXPRESSION ]] would be clearer than [[ EXPRESSION && EXPRESSION ]], in my opinion.
  6. set -o errexit -o noclobber -o nounset -o pipefail and shopt -s globfail would make the error handling much stricter.
  7. This is no longer trivial code, so I'd recommend implementing it in a non-shell language like Python.

Tool suggestions:

  1. Running shellcheck on your script regularly is a good way to capture possible issues. In this case the only thing it finds is for rm -r *x*x*:

    SC2035: Use ./glob or -- glob so names with dashes won't become options.

Specific suggestions:

  1. Function names are by convention snake_case.
  2. Use More Quotes™.
  3. [[ should be used instead of [, because it's safer.
  4. Use [[ -e PATH ]] to check for the existence of a path. So [ -z "$(ls -A ../logs_and_inputs)" ] should be ! [[ -e ../logs_and_inputs ]]. ls is not suitable for scripts (1, 2).
  5. [[ EXPRESSION ]] && [[ EXPRESSION ]] would be clearer than [[ EXPRESSION && EXPRESSION ]], in my opinion.
  6. set -o errexit -o noclobber -o nounset -o pipefail and shopt -s globfail would make the error handling much stricter.
  7. This is no longer trivial code, so I'd recommend implementing it in a non-shell language like Python.

Tool suggestions:

  1. Running shellcheck on your script regularly is a good way to capture possible issues. In this case the only thing it finds is for rm -r *x*x*:

    SC2035: Use ./glob or -- glob so names with dashes won't become options.

added 75 characters in body
Source Link
l0b0
  • 9.1k
  • 22
  • 36

SomeSpecific suggestions:

  1. Function names are by convention snake_case.
  2. Use More Quotes™.
  3. [[ should be used instead of [[[ should be used instead of [, because it's safer.
  4. Use [[ -e PATH ]] to check for the existence of a path.
  5. [[ EXPRESSION ]] && [[ EXPRESSION ]] would be clearer than [[ EXPRESSION && EXPRESSION ]], in my opinion.
  6. set -o errexit -o noclobber -o nounset -o pipefail and shopt -s globfail would make the error handling much stricter.
  7. This is no longer trivial code, so I'd recommend implementing it in a non-shell language like Python.

Tool suggestions:

  1. Running shellcheck on your script regularly is a good way to capture possible issues. In this case the only thing it finds is for rm -r *x*x*:

    SC2035: Use ./glob or -- glob so names with dashes won't become options.

Some suggestions:

  1. Function names are by convention snake_case.
  2. Use More Quotes™.
  3. [[ should be used instead of [, because it's safer.
  4. Use [[ -e PATH ]] to check for the existence of a path.
  5. [[ EXPRESSION ]] && [[ EXPRESSION ]] would be clearer than [[ EXPRESSION && EXPRESSION ]], in my opinion.
  6. set -o errexit -o noclobber -o nounset -o pipefail and shopt -s globfail would make the error handling much stricter.

Tool suggestions:

  1. Running shellcheck on your script regularly is a good way to capture possible issues. In this case the only thing it finds is for rm -r *x*x*:

    SC2035: Use ./glob or -- glob so names with dashes won't become options.

Specific suggestions:

  1. Function names are by convention snake_case.
  2. Use More Quotes™.
  3. [[ should be used instead of [, because it's safer.
  4. Use [[ -e PATH ]] to check for the existence of a path.
  5. [[ EXPRESSION ]] && [[ EXPRESSION ]] would be clearer than [[ EXPRESSION && EXPRESSION ]], in my opinion.
  6. set -o errexit -o noclobber -o nounset -o pipefail and shopt -s globfail would make the error handling much stricter.
  7. This is no longer trivial code, so I'd recommend implementing it in a non-shell language like Python.

Tool suggestions:

  1. Running shellcheck on your script regularly is a good way to capture possible issues. In this case the only thing it finds is for rm -r *x*x*:

    SC2035: Use ./glob or -- glob so names with dashes won't become options.

Source Link
l0b0
  • 9.1k
  • 22
  • 36
Loading