0

I have this example that don't work, and how can I just use the command "curl -sL http:sss.com | grep xxxxx" without having to break into ['','','']

result = subprocess.run(['/usr/bin/curl','-sL',line,'|','grep','-oE','([0-9]{2}[\.][0-9]{3}[\.][0-9]{3}[\/][0-9]{4}[-][0-9]{2})'],stdout=subprocess.PIPE, universal_newlines=True)

Is there a way to simplify?

Zippy
  • 455
  • 1
  • 11
  • 25
  • I believe you're passing `|` as a literal argument to curl. See this q/a: https://stackoverflow.com/questions/13332268/how-to-use-subprocess-command-with-pipes – alter_igel Jul 04 '22 at 22:54
  • Does this answer your question? [How to use \`subprocess\` command with pipes](https://stackoverflow.com/questions/13332268/how-to-use-subprocess-command-with-pipes) – evansrhonda Jul 05 '22 at 04:20

0 Answers0