Github user mallman commented on the pull request:

    https://github.com/apache/spark/pull/6832#issuecomment-118999888
  
    I've spent some more time googling around this problem. Unsurprisingly, 
there's plenty of discussion/frustration around finding a cross-platform 
solution. There doesn't seem to be a magic bullet. In addition to the options 
we've discussed, I think there are two more worth considering. One is to use 
the `-i` flag but passing a backup file suffix like `sed -i.bak ...`. Then 
delete the `.bak` files. This solution is described here: 
http://stackoverflow.com/a/22084103. Another option is to use perl instead of 
sed.
    
    That brings us to four approaches:
    
    1. Look for GNU sed and exit if it can't be found. (what I did)
    1. Write sed output to temporary files and move the temporary files to the 
original files. (what @ScrapCodes did)
    1. Use the `-i.bak` syntax and delete the `.bak` files. This works on GNU 
and BSD sed, but maybe not XYZ or PDQ sed. The point being that `-i` in any 
form just isn't part of the posix standard.
    1. Use `perl -i ...`, which is cross-platform.
    
    At this point I would lean toward either (2) or (4), with (4) being the 
cleaner (easier) implementation. It also assumes the system has perl. Thoughts?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to