Peter Wagner <[email protected]> writes: > - [ -n "$leasefile" ] && [ -e "$leasefile" ] || touch "$leasefile" > + [ -n "$leasefile" ] && ( [ -e "$leasefile" ] || touch "$leasefile" )
Looks like this is fixed already by commit 15fba44a (but see point 6 of http://mywiki.wooledge.org/BashPitfalls and the rest for an interesting read) so the following is academic, but I typed it before checking... It's cheeper to use braces in such cases to avoid subshell creation: [ -n "$leasefile" ] && { [ -e "$leasefile" ] || touch "$leasefile"; } Btw. is the -e test really necessary? Why not simply [ -n "$leasefile" ] && touch "$leasefile" ? -- Regards, Feri. _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
