If TESTS and REBUILD are undefined, set them to false.
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.