开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: Capturing output of rigctl commands with Bash


 

dtmenges@... via groups.io <dtmenges@...> wrote:

rigctl -m 3073 -r /dev/ttyUSB1 -s 115200 get_powerstat

will return a "1" if the power is on. What I'm having trouble with is putting that in a bash .sh file and then capturing that output. It is all part of a bigger project.

As you may surmise, I know just enough about Bash to be dangerous.
Try:

powerstat=$(rigctl -m 3073 -r /dev/ttyUSB1 -s 115200 get_powerstat)

if [ "$powerstat" = "1" ]; then
echo Power is on
else
echo Power is off
fi

Join [email protected] to automatically receive all group messages.