plumbum icon indicating copy to clipboard operation
plumbum copied to clipboard

How to check for retcode when perform stdout redirect

Open ela34 opened this issue 6 years ago • 1 comments

I want to do something like this:

  • downloading a file by redirecting curl output to the file and checking curl retcode

I have try this syntax, and I'm probably doing something wrong, but I cannot find out the correct way to achieve this.

(curl('https://www.mysite.com/file', retcode=0) > 'file.txt')()

This version is working: (curl['https://www.mysite.com/file'] > 'file.txt')()

Any help greatly appreciated. Thanks.

ela34 avatar Aug 29 '17 17:08 ela34