On 5/30/14, 2:50 PM, [email protected] wrote: > I have this patch I wrote a year ago that fixed the broken Ethernet > switch on the AWM002. I've forgotten exactly what I was trying to do. > For some reason the switch was not getting programmed by default. > > What is up with this bit? Why did I need to change it? > - if [ -n "${RT3X5X}" ]; then > + if [ "${RT3X5X}" ]; then
I don't think there is any difference. From "test" man page (OS X):
string True if string is not the null string.
-n string True if the length of string is nonzero.
"null string" == "empty string"
Quick test (AA 12.09, busybox 1.19.4-6):
# X=abc ; if [ -n "$X" ] ; then echo true ; else echo false ; fi ; if [
"$X" ] ; then echo true ; else echo false ; fi
true
true
# X= ; if [ -n "$X" ] ; then echo true ; else echo false ; fi ; if [
"$X" ] ; then echo true ; else echo false ; fi
false
false
# unset X ; if [ -n "$X" ] ; then echo true ; else echo false ; fi ; if
[ "$X" ] ; then echo true ; else echo false ; fi
false
false
--
-Justin
[email protected]
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
