bash/whitespace.sh: hack for allowing normal looking assignments

This commit is contained in:
Nick Chambers 2021-07-25 20:37:56 -05:00
parent daf6eeca41
commit 338cdc646f
1 changed files with 16 additions and 0 deletions

16
bash/whitespace.sh Normal file
View File

@ -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