diff --git a/lib/spack/spack/util/executable.py b/lib/spack/spack/util/executable.py index 3457ea9bff3..c424b9cdb55 100644 --- a/lib/spack/spack/util/executable.py +++ b/lib/spack/spack/util/executable.py @@ -178,7 +178,7 @@ def streamify(arg, mode): istream, close_istream = streamify(input, 'r') if not ignore_quotes: - quoted_args = [arg for arg in args if re.search(r'^"|^\'|"$|\'$', arg)] + quoted_args = [arg for arg in args if re.search(r'^".*"$|^\'.*\'$', arg)] if quoted_args: tty.warn( "Quotes in command arguments can confuse scripts like"