Unify indentation (4 spaces).
Use bash builtin "[[" to perform tests.
If TESTS and REBUILD are undefined, set them to false.
fix
Unify command substitution syntax.
Remove useless cat and echo from ecc_get_value().
Quote all variables to avoid issues with spaces.
Use {push,pop}d to change directory.