title: Shell / Sh Script on a MacBook - How to filter an output in a shell script?
body: <p>I try to filter the output of the shell command
  <code>pmset -g batt</code>. It shows information about the battery status in MacOS. The output is for me </p>
  
  <p><code>Now drawing from 'AC Power'
   -InternalBattery-0 (id=XXXXXXX)    87%; charging; (no estimate) present: true</code></p>
  
  <p>and I just want to have <code>87%</code> as a variable and a variable if it´s charging or not like charging = 1 or 0.</p>
  
  <p>Thanks!</p>