Expand quote_bash_parms to recognize more bash special characters

Also, added call to escape_bash_quotes to properly handle internal
single quotes.

Change-Id: I68ac50048a4c0be8c75849fd6dfe3a609ad6b922
Signed-off-by: Michael Walsh <micwalsh@us.ibm.com>
diff --git a/lib/gen_misc.py b/lib/gen_misc.py
index db7ecf4..6b8d560 100755
--- a/lib/gen_misc.py
+++ b/lib/gen_misc.py
@@ -367,10 +367,22 @@
     # If any of these characters are found in the parm string, then the
     # string should be quoted.  This list is by no means complete and should
     # be expanded as needed by the developer of this function.
-    bash_special_chars = set(' $')
+    # Spaces
+    # Single or double quotes.
+    # Bash variables (therefore, any string with a "$" may need quoting).
+    # Glob characters: *, ?, []
+    # Extended Glob characters: +, @, !
+    # Bash brace expansion: {}
+    # Tilde expansion: ~
+    # Piped commands: |
+    # Bash re-direction: >, <
+    bash_special_chars = set(' \'"$*?[]+@!{}~|><')
 
     if any((char in bash_special_chars) for char in parm):
-        return "'" + parm + "'"
+        return "'" + escape_bash_quotes(parm) + "'"
+
+    if parm == '':
+        parm = "''"
 
     return parm