diff --git a/System.c b/System.c
index ab31effab6018406e46a54e2607d93a57b07bd7e..7ba976d6d42c915c5c9ed9cae4874de8ddd9be99 100644
--- a/System.c
+++ b/System.c
@@ -59,7 +59,7 @@ static int kwsysSystem_Shell__CharIsWhitespace(char c)
 /*--------------------------------------------------------------------------*/
 static int kwsysSystem_Shell__CharNeedsQuotesOnUnix(char c)
 {
-  return ((c == '\'') || (c == '`') || (c == ';') ||
+  return ((c == '\'') || (c == '`') || (c == ';') || (c == '#') ||
           (c == '&') || (c == '$') || (c == '(') || (c == ')'));
 }