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*

4
  • It's throwing "sed: can't read .BAK: No such file or directory" however it's doing the main job correctly Commented Jun 6, 2017 at 11:48
  • @DawidAdach Fixed. No space between i and backup extension. Commented Jun 6, 2017 at 12:52
  • I have odd issue. After removing space as you suggested entire script stopped working :( what is even more surprising, once i revert to the previous version it doesn't append nor update the ~/.bashrc file. $java_esc echo shows correctly escaped path. Is it possible that it has something to do with BAK file? some file permissions? I separated only your code and java path (checked twice and it doesn't work anymore), any idea? (running as sudo) Commented Jun 7, 2017 at 20:14
  • OK, that's odd... I just found the answer. The reason was that I was runnig script with sudo. Without sudo it works like a charm and replaces everything... I am leaving second comment in case someone else face the same issue in a future Commented Jun 7, 2017 at 20:18