Many variable expansions were not properly quoted, which could cause variables with unexpected characters (spaces, wildcards, etc.) to cause unexpected results and very dangerous side-effects.
This patch quotes all variable expansions, except in double-bracket tests (where expansions do not need to be quoted on the left-hand side of operators), and makes all tests double-bracket tests.
Many variable expansions were not properly quoted, which could cause variables with unexpected characters (spaces, wildcards, etc.) to cause unexpected results and very dangerous side-effects.
This patch quotes all variable expansions, except in double-bracket tests (where expansions do not need to be quoted on the left-hand side of operators), and makes all tests double-bracket tests.