E.g., given input file
%DEFINE kieli latina
%DEFINE kissa felis domesticus
Kissa on %kieli%ksi "%kissa%"!
it would print
Kissa on latinaksi "felis domesticus"!
euler.it IN A 184.108.40.206 ; vanha nimbus IN HINFO HP-9000/835 UNIX INFO "Tietotekniikka AgC425.1" ALIAS euler.mit ALIAS nimbus1.mit ETHER 08000902ED2B IN MX 0 badmail.itLines beginning with semicoln are comments, for indented lines machine name is taken from the previous line (i.e., same as on last non-indented non-comment line). Indentations and field separators can be spaces or tabs. Blank lines are ignored.
IP addresses are always on 'IN A' line's last field as four dot-separated numbers 0-255.
Write a script freeip, that finds unused addresses within
given range. The range is given as argument like this:
i.e., only last part as a range.
By default the initial part is assumed to be 130.234. (i.e., freeip 160.25-128 would be same as freeip 220.127.116.11-128) and if last part is omitted, it'll default to 25-255 (only the third part is required).
KEY ALPHA 3 KEY BETA 1 ALPHA note 1 and some junk GAMMA junk BETA something DELTA who cares about this KEY DELTA 4 ALPHA me too KEY BETA 0 DELTA this is important (maybe) BETA this is junk ...Write a script that processes it as follows:
Lines beginnning with KEY define how many fields will be printed for lines beginning with corresponding key.
E.g., KEY ALPHA 2 means that for lines beginning with ALPHA after that will be printed with two first fields (including the word ALPHA), KEY BETA 0 that lines beginning with BETA will not be printed at all thereafter. So, for the input above it'd print
ALPHA note 1 BETA ALPHA me too DELTA this is importantThe number of keys and fields is arbitrary and they can have any visible characters (no spaces, tabs or newlines). Fields are separated by spaces only.