You are not logged in.
I'm currently trying to come up with some system documentation that can be dynamically updated. Ideal usage would be to have a template file and a Makefile in a directory and be able to just type make to update my system documentation. A template file would look something like but be more complicated obviously:
Output of ifconfig:
%% ifconfig %%
The %% ifconfig %% would be replaced by the output of the command, in this case ifconfig.
I could do this in python but would like something just requiring the basic built in utilities, sed, awk, etc and a makefile.
Has anyone done something similar or knows how I might do this?
This:
test.txt: test.template
sed 's/%%\(.*\)%%/\1/' <test.template >test.txt
is as close as I can get with sed. Backticks don't seem to work inside the 's/../../' expression but maybe there is another way?
Regards,
Mike
Last edited by mikesd (2009-01-22 03:14:01)
Offline