# # RewriteConf.awk script to rewrite the @@ServerRoot@@ tags in httpd.conf # # Note that we -don't- want the ARGV file list, so no additional {} blocks # are coded. Use explicit args (more reliable on Win32) and use the fact # that ARGV[] params are -not- '\' escaped to process the C:\Foo\Bar Win32 # path format. Note that awk var=path would not succeed, since it -does- # '\' escape the assignment. # BEGIN { srcfl = ARGV[1]; dstfl = ARGV[2]; serverroot = ARGV[3]; domain = ARGV[4]; servername = ARGV[5]; serveradmin = ARGV[6]; gsub( /\\/, "/", serverroot ); serverroot = substr( serverroot, 0, length( serverroot ) - 2 ); while ( ( getline < srcfl ) > 0 ) { gsub( /@@ServerRoot@@/, serverroot ); gsub( /@@Domain@@/, domain ); gsub( /@@ServerName@@/, servername ); gsub( /@@ServerAdmin@@/, serveradmin ); print $0 > dstfl; } }