4 ms·
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 \(
by a3_nm 13y 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'
- comex 13y agoSounds 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.