Posted: Wed Mar 27, 2019 20:29 Post subject: Re: Why won't this script run in the Command screen
aaronburro wrote:
Seriously, what am I doing wrong here?
Use SSHd or telnet...
The Command window in the webif is hit or miss on what it interprets correctly??...only causing erratic resaults...been that way for a long time...
Some functions work....so we can't call it broken _________________ Location 1
R7800- DD-WRT v3.0-r53562 (10/03/23) Gateway
WNDR3400v1 DD-WRT v3.0-r35531_mega-nv64k (03/26/18 ) Access Point
WRT160Nv3 DD-WRT ?v3?.0-r35531 mini (03/26/18 ) Access Point
WRT54GSv5 DD-WRT v24-r33555_micro_generic (10/20/17) Repeater
Location 2
R7800- DD-WRT v3.0-r51855 (02/25/23) Gateway
R6300v2- DD-WRT v3.0-r50671 (10-26-22) Access Point
WNDR3700v2 DD-WRT v3.0-r35531 std (03/26/18 ) Access Point
E1200 v2 DD-WRT v3.0-r35531 mega-nv64k (03/26/18 ) Gateway(for trivial reasons)
RBWAPG-5HACT2HND-BE RouterOS-v6.46.4 (2/21/20) Outdoor Access Point
2x RBSXTG-5HPACD RouterOS-v6.46.4 (2/21/20) PTP Bridge 866.6Mbps-1GbpsLAN
Location 3
2x R7000- DD-WRT v3.0-r50671 (10/26/22) Access Points
2x RBWAPG-60AD RouterOS-v6.45.9 (04/30/20) PTP Bridge 2.3Gbps-1GbpsLAN
2x RBSXTsqG-5acD RouterOS-v6.49.7 (10/14/22) PTP Bridge 866.6Mbps-1GbpsLAN Thank You BrainSlayer for ALL that you do & have done, also to "most" everyone here that shares their knowledge
if you do an echo $food is it blank? If so that is not a valid value and gives you an out of range. The assignments are just variable to variable ie number. If your script is trying to assign words to a variable you use "food" and "bard" (put in quotes) but then you need to change your comparison
Code:
!/bin/sh
FOO="food"
BAR="bard"
if [ $FOO != $BAR ]
then
echo "hmmm"
fi
or for numbers:
Code:
FOO=3
BAR=5
if [ $FOO -ne $BAR ]
then
echo "hmmm"
fi
Thx for helping me remove my head from my butt. I didn't expect there to be a difference between -ne and !=. Still feeling my way around Linux and bash/sh