Shell command to report power status

Posted by: TheAmigo

Shell command to report power status - 21/02/2003 23:07

I'm guessing that probably nobody will find these usefull, but here they are just in case.

Two simple progs: ac and dc. The ac program reads /proc/empeg_power and returns true if the empeg is on ac and false if it's on dc. The dc prog is the other way 'round.

Why? It's less CPU and RAM overhead than grep "Power)" /proc_empeg_power | grep -c AC.
Posted by: tman

Re: Shell command to report power status - 22/02/2003 06:40

Ah. But if you use open/read/close instead of the buffered IO functions it should save you a little more RAM
Using return instead of exit probably should shave a little more off the binary as well.

Sorry, being picky

- Trevor