|
From: | Joachim Mammele |
Subject: | assigning a value to a variable in 00_header |
Date: | Wed, 02 May 2012 15:12:48 +0200 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 |
Hi everybody, I'd like to add a value to a user variable in 00_header but I get the error "not an assignment". but if I echo directly the value everything works fine. What can I do? How can I use a variable my_variable? Is there another way to check for different values of \$? ? Any help would be appreciated. Greetings Joachim this is what is working fine: checkfrontkeys echo "pressed key: \$?" ------------- this is what I'm struggling with (I've also been trying to use "case \$? "instead of "if $pressed_key" but this didn't work neither): checkfrontkeys set pressed_key = $? echo "pressed key: " echo $pressed_key echo "\n" if [ $pressed_key == 1 ]; then echo "pressed 1" set default="1" elif [ $pressed_key == 2]; then echo "pressed 2" set default="2" elif [ $pressed_key == 3]; then echo "pressed 3" set default="3" elif [ $pressed_key == 4]; then echo "pressed 4" set default="4" else echo "nothing pressed\n" set default="6" fi echo "default = ${default}\n" echo "after checkfrontkeys" |
[Prev in Thread] | Current Thread | [Next in Thread] |