-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jo-Philipp Wich <j...@openwrt.org> wrote: > Hi. > > > Why the -e? You only got existing files in the glob above right? > > Almost. If the directory does not exist or is empty then the glob > pattern is returned literally, e.g. "echo /tmp/*" will expand to a list > of files but "echo /does_not_exist/*" will return "/does_not_exist/*" > literaly so the for-in loop will run once with the literal glob pattern > as argument, therefore the "-e" test is required.
So let's -d test the directory instead of -e testing every file just in case the directory didn't exist? Cheers, Karl P -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBAgAGBQJV6YbLAAoJEBmotQ/U1cr2Pb4P/2tUHJeZFU2sNNCTwHXFA8hQ qnAXHwDY+Jmug0HdDDqmoykKoBx2H4PX96uQK2faK9lsbCHzOKZz8FOZACgrlmyg v4LB7YtDIhQsEZ3OvnXVtb5uGWeJuysu53u05omJHbZC6YJNIk2Z1OBzgwVOU2Fb uRO+mkbNNQjhw2scQH4vZeX9HwQVfJTPe6ysf6z8r0H6wdAtsqAkyyR491HM1XJ4 8UBgZn4HT7AAsrAHdeswXu/lpqHsbccJ8QbHoXG5sE+ua8kWofh2q80bRWUAmTlV TeVGmSP6iI/7xDps0KEPwYSwc0VRYclrpyf858Xk8Y2Y1KXNjcCRbfB8Tp3ObT7Y D4EVGottH2J2g16FsAYgSvLLftU/qe9z3HPl5l5kMNZRwXmHQ6BOT1ibvECpZv22 r5fGmIxRrBCWgRBfxTQyqZAxdGU2GyqllUSVBDt6TxybVnBtEmwbFF0GqVJbbrCx IJPcKwHqjgMIFSEBZPzKKLCLK3pcl+OXCi8YnwtErb7nxIsTsrvB9ipygOp6n/as Z9dxcGqGw9FAeNFAdhXxtQMGVb/rTO/Oqpycn6GjRGu+tjyI3ibfKoI/8OzvRqcA SLCJqraPEtNCNcQHXDlyp+bzp0vcMrbwoMMXHiiXbX3oKbsPpmLcDsQN+GgiDaLx im/w8GwL4UHUbSOLdXrX =5DvD -----END PGP SIGNATURE-----
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel