I am trying to run this script:
test.sh
#!/bin/bash
BAT_LEVEL=`acpi -b |grep -Eo "[0-9]+%"|grep -Eo "[0-9]+"`
CRIT=0
if [ $BAT_LEVEL -gt $CRIT ]; then
echo "foo"
aplay ~/apert.wav
notify-send "Battery-Low"
echo "bar"
fi
The sixth line from above which is notify-send "Battery-Low"
works just as you'd expect in terminal.
But when the script is executed it just spits out foo
and bar
on stdout.
I have no clue what the problem might be.
./test.sh
in the directory of the file insideM-x shell
of emacs.aplay
line gives me some error too.