i could cut the way and the time
if condition1; then
foo1
elif condition2; then
foo2
else
foox
fi
#! /bin/sh
set -e
sub phone_is_charging() {
lshal -u /org/freedesktop/Hal/devices/bme | grep -iq "maemo.rechargeable.charging_status = 'on'"
}
sub set_profile_and_foo() {
foo $1
}
# main logic starts here
if phone_is_charging; then
set_profile_and_foo General
else
set_profile_and_foo Silent
fi
#! /bin/bash
sub foo() {
local x="$1"
echo $x
}
x=xyzzy
foo bar
echo $x
foo="$(cat "$filename")"
test "$variable" = "yes" test "x$variable" = "xyes" # if you're paranoid
| The Following User Says Thank You to wnd For This Useful Post: | ||