Y
Hacker News
new
|
ask
|
show
|
jobs
by
a3_nm
4584 days ago
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'
1 comments
comex
4584 days ago
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.
link