Timeline for Efficiently compare If variable exists and is not equal
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 20, 2016 at 17:41 | history | edited | DopeGhoti | CC BY-SA 3.0 |
Handle case of both variables being unset.
|
| May 20, 2016 at 17:41 | comment | added | DopeGhoti | Easily fixed. I shall do so forthwith. | |
| May 18, 2016 at 21:49 | comment | added | Gilles 'SO- stop being evil' |
Your proposal with ${OldIP:=unset} fails the value of StartIP is unset. If these are IP addresses as the name suggests, this won't arise, but it makes the code fragile: what if the script supports host names one day?
|
|
| May 18, 2016 at 21:21 | comment | added | cas |
! -z "STRING" is the same as -n "STRING" (or just "STRING")
|
|
| May 18, 2016 at 17:38 | history | answered | DopeGhoti | CC BY-SA 3.0 |