dundalek / closh

Bash-like shell based on Clojure
Eclipse Public License 1.0
1.61k stars 65 forks source link

Adjacent symbols and strings considered as two tokens #156

Open dundalek opened 4 years ago

dundalek commented 4 years ago

For example a common pattern of passing environmnet variables:

$ env DB_HOSTNAME="localhost" bash -c "echo ${DB_HOSTNAME}"

errors with:

env: ‘localhost’: No such file or directory

This is because adjacent symbol and string is considered as two tokens, so it is the same as:

env DB_HOSTNAME= localhost

A workaround is to wrap the whole thing in quotes, but it is not very nice:

env "DB_HOSTNAME=localhost"