Skip to content

Commit

Permalink
add asterisk as a shell-inducing character
Browse files Browse the repository at this point in the history
  • Loading branch information
nsheff committed Aug 12, 2016
1 parent 9184023 commit 46185a6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pypiper/pypiper.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,14 +479,15 @@ def checkprint(self, cmd, shell="guess", nofail=False):
"""
self.report_command(cmd)


if shell == "guess":
if ("|" in cmd or ">" in cmd):
if ("|" in cmd or ">" in cmd or r"*" in cmd):
shell = True
else:
shell = False

if not shell:
if ("|" in cmd or ">" in cmd):
if ("|" in cmd or ">" in cmd or r"*" in cmd):
print("Should this command run in a shell instead of directly in a subprocess?")

#cmd = cmd.split()
Expand Down Expand Up @@ -536,13 +537,13 @@ def callprint(self, cmd, shell="guess", nofail=False):
self.proc_name = "".join(cmd).split()[0]

if shell == "guess":
if ("|" in cmd or ">" in cmd):
if ("|" in cmd or ">" in cmd or "*" in cmd):
shell = True
else:
shell = False

if not shell:
if ("|" in cmd or ">" in cmd):
if ("|" in cmd or ">" in cmd or "*" in cmd):
print("Should this command run in a shell instead of directly in a subprocess?")
#cmd = cmd.split()
cmd = shlex.split(cmd)
Expand Down

0 comments on commit 46185a6

Please sign in to comment.