<...>
# make sure openbox is going to be run
if test -z "$SESSION"; then
# if its empty then just run openbox
SESSION="[openbox]"
elif test -z $(echo "$SESSION" | grep -q openbox); then
# if openbox isn't in the session then append it
SESSION="${SESSION%]},openbox]"
fi
<...>
`grep -q' never prints anything, so `test -z $(...)' will always evaluate to "true"
This still doesn't seem to work correctly. The return value from grep needs to be inverted.
- elif echo "$SESSION" | grep -q openbox; then
+ elif ! echo "$SESSION" | grep -q openbox; then
<...> # make sure openbox is going to be run if test -z "$SESSION"; then # if its empty then just run openbox SESSION="[openbox]" elif test -z $(echo "$SESSION" | grep -q openbox); then # if openbox isn't in the session then append it SESSION="${SESSION%]},openbox]" fi <...> `grep -q' never prints anything, so `test -z $(...)' will always evaluate to "true"