diff --git a/bash/whitespace.sh b/bash/whitespace.sh new file mode 100644 index 0000000..4db2de7 --- /dev/null +++ b/bash/whitespace.sh @@ -0,0 +1,16 @@ +command_not_found_handle() { + if [[ $2 != =* ]]; then + printf '%s: %s: command not found\n' "$0" "$1" >&2 + fi +} + +make_assign() { + local name equal value + read -r name equal value <<< "$BASH_COMMAND" + + if [[ $equal = =* ]]; then + declare -g "$name$equal$value" + fi +} + +trap make_assign DEBUG