From: Tails developers Date: Fri, 7 Dec 2012 21:31:36 +0000 (+0100) Subject: Using 'local' in a safe way. X-Git-Tag: debian/3.0_b9-1~1 X-Git-Url: http://git.grml.org/?a=commitdiff_plain;h=7f275599f4d4c8800d1bbf6ee275328d033a7438;hp=7f275599f4d4c8800d1bbf6ee275328d033a7438;p=live-boot-grml.git Using 'local' in a safe way. First of all, 'local' is non-POSIX, but it is a really good safeguard against hard-to-find bugs. However, doing a local + initializing combo like `local X=$Y` in dash is error prone. If `Y=1 2` will get an error since dash will expand $Y so we get `local X=1 2`, but it will treat the "2" as another variable to be made local, which isn't what we want. Hence, let's declare variables local and initialize them in separate commands, which is safe. ---