BASH 12
PengPod-battinfo.sh By jimmyd on 18th September 2021 07:17:52 AM
  1. #!/bin/sh
  2. INFO=$(grep -e "STATUS\|HEALTH\|CAPACITY" /sys/class/power_supply/battery/uevent | awk -F= '{print $2}')
  3.  
  4. STATUS=$(echo $INFO | awk '{print $1}')
  5. HEALTH=$(echo $INFO | awk '{print $2}')
  6. CAPACITY=$(echo $INFO | awk '{print $3}')
  7.  
  8. echo "Status: $STATUS"
  9. echo "Health: $HEALTH"
  10. echo "Capacity: $CAPACITY"

PasteIT is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.