0

The file in question is /sys/class/power_supply/BAT0/status.

When I cat it, I receive Full. But when I do status="$(cat /sys/class/power_supply/BAT0/status)" and then echo status, I receive 1 when I want it to output Full. I'm sure I'm just being an idiot and missing something obvious. Any help is appreciated.

LTWood
  • 25
  • 5

1 Answers1

2

This is probably designed for bash. In zsh you get 1 for error:

zsh: read-only variable: status

status is a reserved variable. Try my_status.

Beko Pharm
  • 306
  • 1
  • 6