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*

3
  • Have you tried abandoning cat altogether and just using the sed -e 'expression_here' file_name syntax? You're guilty of a useless use of cat there. Also, it may not be necessary with the particular example you specified but semantically, I think you need a g modifier on your sed regex. Commented Jul 31, 2013 at 23:28
  • I don't think you can execute code inside of a sed either. It was covered earlier in this question today: unix.stackexchange.com/questions/85082/… Commented Jul 31, 2013 at 23:33
  • @slm: You can execute code inside of a sed. Try echo foo | sed "s/foo/$(uptime)/" Commented Aug 1, 2013 at 4:51