Hacker News new | past | comments | ask | show | jobs | submit login

You can use sed's external command mechanism to do that. This replaces lines of the form "include foo.txt" with the contents of foo.txt.

    sed 's/^include \(.*\)/cat "\1"/e'



Sounds useful, but it's not portable, and doesn't work on OS X. I suppose I could just switch to GNU sed, since I mostly care about interactive use, but thus far I haven't done so.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: