You are not logged in.
Pages: 1
I was trying this setup for an xinitrc file:
DEFAULT_SESSION=awesome
case $1 in
kde) exec startkde;;
xfce4) exec startxfce4;;
wmaker) exec wmaker;;
blackbox) exec blackbox;;
awesome) exec awesome;;
openbox) exec openbox;;
musca) exec musca;;
wmii) exec wmii;;
enlightenment) exec e16;;
ratpoison) exec ratpoison;;
etoile) exec etoile;;
compiz) exec compiz;;
) exec $DEFAULT_SESSION
*) exec $1;;
esac
Seems like it should work right? Well I guess Bash doesn't like the null case, and throws it out as a syntax error. Anyone know of a way around this?
The reason I wanted to do this is because sometimes I'll just want to add a WM to /etc/slim.conf just to test it out.
Libertarian Arch Linux User
Offline
Offline
Ok thanks.
But do you need a semicolon after every command? I thought it just used the newline like Python. I think it still works fine.
Libertarian Arch Linux User
Offline
http://tldp.org/LDP/Bash-Beginners-Guid … 07_03.html
Each case is an expression matching a pattern. The commands in the COMMAND-LIST for the first match are executed. The "|" symbol is used for separating multiple patterns, and the ")" operator terminates a pattern list. Each case plus its according commands are called a clause. Each clause must be terminated with ";;". Each case statement is ended with the esac statement.
M*cr*s*ft: Who needs quality when you have marketing?
Offline
Pages: 1