You are not logged in.
Pages: 1
I have this script from urukrama openpox blog:
#!/bin/bash
prog="
bashrc
conky
dmenu-cache
gtkrc
menu.xml
rc.xml
rtorrentrc
xdefaults"
cmd=$(dmenu -nb '#000000' -nf '#ECDDA6' -sb '#000000' -sf '#b23308' -fn "-*-nu-*-*-*-*-*-*-*-*-*-*-*-*" <<< "$prog")
if ${cmd%% *} then
gtkrc) exec leafpad "/home/botzoboy/.gtkrc-2.0" ;;
xdefaults) exec leafpad "/home/botzoboy/.Xdefaults" ;;
conky) exec leafpad "/home/botzoboy/.conkyrc" ;;
dmenu-cache) exec leafpad "/home/botzoboy/.dmenu_cache" ;;
rc.xml) exec leafpad "/home/botzoboy/.config/openbox/rc.xml" ;;
menu.xml) exec leafpad "/home/botzoboy/.config/openbox/menu.xml" ;;
ob-autostart) exec leafpad "/home/botzoboy/.config/openbox/autostart.sh" ;;
rtorrentrc) exec leafpad "/home/botzoboy/.rtorrent.rc" ;;
*) exec "'${cmd}'" ;;
fi
If I run it from the file manger I get this:
Failed to execute file "configdmenu".
Failed to execute child process "/home/botzoboy/configdmenu" (No such file or directory).
If I run it fron terminal I get this:
: command not found:
: command not found2:
: command not found4:
configdmenu: line 16: syntax error near unexpected token `)'
'onfigdmenu: line 16: ` gtkrc) exec leafpad "/home/botzoboy/.gtkrc-2.0" ;;
Can someoane to tell me what is the problem???
Last edited by botzoboy (2010-08-28 17:46:48)
Offline
It looks like that if statement should be a case statement instead. Change "if ${cmd%% *} then" to "case ${cmd%% *} in" and change "fi" to "esac", which will hopefully fix it
"You can watch for your administrator to install the latest kernel with watch uname -r" - From the watch man page
Offline
not working, now i get this:
: command not found:
: command not found2:
: command not found4:
'onfigdmenu: line 15: syntax error near unexpected token `in
'onfigdmenu: line 15: `case ${cmd%% *} in
Offline
you might need to quote ${cmd%% *} with double quotes. I'm really just guessing here, maybe you should write your own script
"You can watch for your administrator to install the latest kernel with watch uname -r" - From the watch man page
Offline
I have no clue about bash scripting. The script is supposed to work. I taked the script from here:
http://urukrama.pastebin.com/f74ca72ac
Maybe someone can take it and debug it
Thanks!
Offline
I have no clue about bash scripting. The script is supposed to work. I taked the script from here:
Never too late to learn. This script is simple enough that it might be a good exercise to dissect it and understand it. The Wooledge Wiki provides the most excellent BashGuide as well as the BashFAQ which will very likely answer all your questions. The bash-hacker's wiki has also been a valuable resource for me.
http://urukrama.pastebin.com/f74ca72ac
Maybe someone can take it and debug it
Thanks!
pastebin seems to be down. Have you bothered to try PirateJonno's and my suggestions?
Offline
Yes i tried all that you suggested but without success. Pastebin is working now anyway here is the original script:
#!/bin/bash
prog="
9menu
awesomerc
bashrc
bbdock
bbpager
bbtime
clock-awesome
config-dmenu
conky
dmenu-cache
dzen-calendar
dzen-remind
fonts.conf
gtkrc
gtkrc.mine
menu.xml
mpdconf
netwmpager
ob-autostart
osdsh
osdsh-theme
pekwm-autoproperties
pekwm-config
pekwm-keys
pekwm-menu
pekwm-mouse
pekwm-start
pypanelrc
rc.xml
remind-awesome
reminders
rtorrentrc
screenrc
shutdown
sithwmrc
skippyrc
xdefaults
xlock
xlocktext
xsession-errors"
cmd=$(dmenu -nb '#000000' -nf '#ECDDA6' -sb '#000000' -sf '#b23308' -fn "-*-nu-*-*-*-*-*-*-*-*-*-*-*-*" <<< "$prog")
case ${cmd%% *} in
9menu) exec mousepad "/home/urukrama/.9menurc";;
gtkrc) exec mousepad "/home/urukrama/.gtkrc-2.0" ;;
xdefaults) exec mousepad "/home/urukrama/.Xdefaults" ;;
bashrc) exec mousepad "/home/urukrama/.bashrc" ;;
awesomerc) exec mousepad "/home/urukrama/.awesomerc" ;;
reminders) exec mousepad "/home/urukrama/.reminders" ;;
gtkrc.mine) exec mousepad "/home/urukrama/.gtkrc.mine" ;;
fonts.conf) exec mousepad "/home/urukrama/.fonts.conf" ;;
mpdconf) exec mousepad "/home/urukrama/.mpdconf" ;;
screenrc) exec mousepad "/home/urukrama/.screenrc" ;;
xsession-errors) exec mousepad "/home/urukrama/.xsession-errors" ;;
shutdown) exec mousepad "/home/urukrama/.scripts/shutdown" ;;
dzen-calendar) exec mousepad "/home/urukrama/.scripts/dzen_calendar_awesome" ;;
dzen-remind) exec mousepad "/home/urukrama/.scripts/dzen_remind_awesome" ;;
remind-awesome) exec mousepad "/home/urukrama/.awesome/awesome-remind.sh" ;;
clock-awesome) exec mousepad "/home/urukrama/.awesome/awesome-clock.sh" ;;
config-dmenu) exec mousepad "/home/urukrama/.scripts/config_dmenu_script" ;;
netwmpager) exec mousepad "/home/urukrama/.config/netwmpager/config" ;;
osdsh) exec mousepad "/home/urukrama/.config/osdsh/osdsh_script" ;;
osdsh-theme) exec mousepad "/home/urukrama/.config/osdshawesome" ;;
conky) exec mousepad "/home/urukrama/.conkyrc" ;;
dmenu-cache) exec mousepad "/home/urukrama/.dmenu_cache" ;;
xlock) exec mousepad "/home/urukrama/.scripts/xlock" ;;
xlocktext) exec mousepad "/home/urukrama/.scripts/xlocktext" ;;
pypanelrc) exec mousepad "/home/urukrama/.pypanelrc" ;;
rc.xml) exec mousepad "/home/urukrama/.config/openbox/rc.xml" ;;
menu.xml) exec mousepad "/home/urukrama/.config/openbox/menu.xml" ;;
skippyrc) exec mousepad "/home/urukrama/.skippyrc" ;;
sithwmrc) exec mousepad "/home/urukrama/.sithwmrc" ;;
pekwm-keys) exec mousepad "/home/urukrama/.pekwm/keys" ;;
pekwm-mouse) exec mousepad "/home/urukrama/.pekwm/mouse" ;;
pekwm-config) exec mousepad "/home/urukrama/.pekwm/config" ;;
pekwm-autoproperties) exec mousepad "/home/urukrama/.pekwm/autoproperties" ;;
pekwm-menu) exec mousepad "/home/urukrama/.pekwm/menu" ;;
pekwm-start) exec mousepad "/home/urukrama/.pekwm/start" ;;
ob-autostart) exec mousepad "/home/urukrama/.config/openbox/autostart.sh" ;;
bbpager) exec mousepad "/home/urukrama/.bbtools/bbpager.rc" ;;
bbtime) exec mousepad "/home/urukrama/.bbtools/bbtime.nobb" ;;
bbdock) exec mousepad "/home/urukrama/.bbdockrc" ;;
rtorrentrc) exec mousepad "/home/urukrama/.rtorrentrc" ;;
*) exec "'${cmd}'" ;;
esac
Thank falconindy for your wiki about bash, right now I started to read how to debug a script maybe I can get it
Offline
I get it to work. The problem was that the script hat the line endings with "\r". I just rewrited the script line by line and now it works like a charm. I didnt thought that the problem can be "Text File Format Compatibility".
Thaks all for help!!
Offline
Pages: 1