#!/bin/bash if [ "q$1" == "q-a" ] ; then online=`cat /sys/class/power_supply/AC/online` if [ "q$online" == "q1" ] ; then echo "on-line" else echo "off-line" fi echo $online else echo "bbbbbbb" fi