Hello fellow freeBSD forum members,
Can you please help
Is there anyway to save the following into a variable?
What I would like to do is check to see if this output is != null when true adjust some LEDS
The following does not function as expected:
What I would like to occur is save the output as a string variable into str with echo
use the if statement to check if it is not null if its not it will run the two commands after
that's it.
Can you please help
Is there anyway to save the following into a variable?
What I would like to do is check to see if this output is != null when true adjust some LEDS
The following does not function as expected:
Code:
#!/bin/sh
str=`pfctl -vvss | grep ‘, rule 79’`
str = echo $str
if [! -n “$str” ]
then
sysctl -q dev.gpio.2.led.2.pwm=1
gpioctl -f /dev/gpioc2 6 duty 1 >/dev/null
fi
fi
use the if statement to check if it is not null if its not it will run the two commands after
that's it.