1 2 3 4 5 6
#! /usr/bin/env sh shopt -s nullglob for bat in /sys/class/power_supply/BAT* do cat $bat/{capacity,status} done