Ventto / mons

POSIX Shell script to quickly manage monitors on X
MIT License
632 stars 39 forks source link

Daemon mode doesn't work on Ubuntu with dash as /bin/sh #41

Open tomparkin opened 4 years ago

tomparkin commented 4 years ago

By default Ubuntu runs dash as /bin/sh, which fails to evaluate:

[ "$(<"$status")" = 'connected' ] && i=$((i+1))

https://www.shellcheck.net/ says:

SC2039: In POSIX sh, $(<file) to read files is undefined.

It seems the idiom is a bashism.

To fix on my Ubuntu system I changed the mons script shabang to /bin/bash rather than /bin/sh,