CommentStreams:A70a923c8dbbdd9cad233cfd3af1fbcf
See Anonymous User #2's comment. That was the problem. When the extra character is stripped from the lines, the script executes as advertised and the two functions, software shutdown and print battery capacity work.
Many thanks.