Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • @stéphane-chazelas , feel free to add comments to this answer, or suggest other improvements to the OPs code, but the bash script I pasted here was intentionally the minimal change to the OPs script to make it work, and while the aside about other shells is a perfectly good point, the answer isn't incorrect without it. Commented Jul 3, 2014 at 16:57
  • However, the answer is incorrect with bugs and bad practises without the fixes I suggested. I agree those errors were in the question in the first place, and it's your answer, you do whatever you want with it, but my view would be to make sure answers always contain correct code if possible, as people may end up copy-pasting code from it (while they wouldn't do that from the question) Commented Jul 3, 2014 at 18:41