News for hackers. Stuff that matters.
Re:When Bash scripts bite by dmoreno on Friday May 12, 2017 @03:58AM (#14322178)
I was just thinking how cool would it be to have a module in python to really ease generating bash style scripts, with less overhead than normal `subprocess` methods have... And there was it just a Google search away: https://pypi.python.org/pypi/sh/1.12.13
Re:When Bash scripts bite by annnnd on Friday May 12, 2017 @04:42AM (#14322334)
Ok, looks great, but... I wonder what "gotchas" this module (and Plumbum) has? Does anyone use this in production?

EDIT: just learned that PBS is now sh.py, so I removed it from the comment.

Re:When Bash scripts bite by daenz on Friday May 12, 2017 @05:45AM (#14322583)
Author of sh.py here. It seems to be used by many people in production around the world. I've actively maintained it since 2011, and it supports python 2.6-3.6, inclusive. Most of the gotchas have been worked out by now, but the FAQ covers the most common stumbling blocks: http://amoffat.github.io/sh/sections/faq.html
Re:When Bash scripts bite by annnnd on Friday May 12, 2017 @06:48AM (#14322841)
Thank you! Can I suggest that you link to documentation from your pypy page? Nice work btw.
Re:When Bash scripts bite by radiowave on Friday May 12, 2017 @08:04AM (#14323212)
Yes please do that. I failed to find the documentation when I had a brief click around earlier today. (Mind I wasn't trying very hard.)
Re:When Bash scripts bite by marcosdumay on Friday May 12, 2017 @11:16AM (#14324713)
Re:When Bash scripts bite by Tistron on Friday May 12, 2017 @06:02AM (#14322655)
This looks super nice, does anybody know of something similar in js that is well made?
Re:When Bash scripts bite by helb on Friday May 12, 2017 @04:07AM (#14322208)
That looks great, thanks!

Related HN thread from almost 5 years ago: https://news.ycombinator.com/item?id=4530897

Re:When Bash scripts bite by plesn on Friday May 12, 2017 @12:15PM (#14325257)
I would kill to have this module in the batteries included…
Re:When Bash scripts bite by therealmarv on Friday May 12, 2017 @04:05AM (#14322198)
yes, subprocess is a pain in the a. Thanks for the recommendation!