KDE env broken in startkde because of dash?
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
kdebase (Ubuntu) |
Invalid
|
Undecided
|
Daniel Hahler |
Bug Description
Binary package hint: ksmserver
I have a number of scripts in ~/.kde/env folder to setup various KDE environment variables including KDEWM.
Startkde has a shebang of /bin/sh and /bin/sh is linked by default to dash
The following code in startkde does not work correctly under dash...
exepath=`kde-config --path exe | tr : '\n'`
for prefix in `echo "$exepath" | sed -n -e 's,/bin[
for file in "$prefix"*.sh; do
test -r "$file" && . "$file"
done
done
tested using the following shell script under bash and dash...
exepath=`kde-config --path exe | tr : '\n'`
for prefix in `echo "$exepath" | sed -n -e 's,/bin[
for file in "$prefix"*.sh; do
echo prefix = $prefix , file = $file
done
done
which returns the following under bash (OK): -
prefix = /home/paul/
prefix = /home/paul/
prefix = /usr/env/ , file = /usr/env/*.sh
and this under dash (NOTOK): -
prefix = /home/paul/
prefix = /usr/env/ , file = /usr/env/*.sh
...hence the startkde line (test -r "$file" && . "$file") does not work and scripts do not get executed.
WORKAROUND: link /bin/sh to bash
This is caused by a regression is dash (bug 177032).
I'll provide a debdiff to work around it in a minute.