- print "RRD_VERSION = " my_ver "";
- print "RRD_VERSION_STR = " my_ver_str "";
- print "RRD_NUMVERS = " my_num_ver "";
+ # read from from input file, replace placeholders, and write to STDOUT
+ if (ARGV[2]) {
+ while ((getline < ARGV[2]) > 0) {
+ if (match ($0, /@@NUMVERS@@/)) {
+ gsub("@@NUMVERS@@", my_ver_num, $0);
+ }
+ if (match ($0, /@@PACKAGE_VERSION@@/)) {
+ gsub("@@PACKAGE_VERSION@@", "" my_ver_str "", $0);
+ }
+ print;
+ }
+ } else {
+ print "RRD_VERSION = " my_ver "";
+ print "RRD_VERSION_STR = " my_ver_str "";
+ print "RRD_NUMVERS = " my_ver_num "";
+ }