@@ -354,7 +354,7 @@ __process_include() {
354354 if ($0 ~ /^#/) {
355355
356356 # Replace the include in the comment
357- gsub("include", "import")
357+ # gsub("include", "import")
358358
359359 print original
360360 next
@@ -369,7 +369,8 @@ __process_include() {
369369 next
370370 }
371371
372- # print "imported " $2
372+ # print "#import " $2
373+ print "#import " original
373374
374375 # system("cat " $2)
375376 # print ">> "
@@ -390,7 +391,7 @@ __process_include() {
390391 $2 = NGINX_CONFIG_HOME "/" $2
391392 }
392393
393- print "# " original
394+ # print "# " original
394395
395396 # The second way
396397 # find . -maxdepth 1 -print0 | xargs -0 command
@@ -403,10 +404,34 @@ __process_include() {
403404 # system("ls -1 " $2 " 2>/dev/null | xargs -I {} cat {} ")
404405
405406 # Using sh has security implications deprecated
406- system("ls -1 " $2 " 2>/dev/null | xargs -I {} sh -c \"cat {} && echo\" ")
407+ # system("ls -1 " $2 " 2>/dev/null | xargs -I {} sh -c \"cat {} && echo\" ")
407408
408409 #
409- system("ls -1 " $2 " 2>/dev/null | xargs -I {} sed -n \"$p\" {} ")
410+ # system("ls -1 " $2 " 2>/dev/null | xargs -I {} sed -n \"$p\" {} ")
411+
412+ # xargs -I {} awk -v FP="{}" "BEGIN{ print \"# include \" FP } {print} END{print ""} " {}
413+ #system("ls -1 " $2 " 2>/dev/null | xargs -I {} awk \" {print} END {print \"\" } \" {} ")
414+ #
415+ # cmd = "ls -1 " $2 " 2>/dev/null | xargs -I {} awk \" {print} END {print \"\\\"\"\n\"\\\"\" } \" {} "
416+
417+ # cmd = "ls -1 " $2 " 2>/dev/null | xargs -I {} awk \"BEGIN {print \"\"{}\"\" } {print} END {print \n } \" {} "
418+
419+ # OK Add a newline character to the end of the file
420+ # cmd = "ls -1 " $2 " 2>/dev/null | xargs -I {} awk \" {print} END {print \"\\n\" } \" {} "
421+
422+ # OK Add a newline character to the end of the file
423+ # cmd = "ls -1 " $2 " 2>/dev/null | xargs -I {} awk ' \' ' {print} ' \' ' {} "
424+
425+ # OK add config file path
426+ #cmd = "ls -1 " $2 " 2>/dev/null | xargs -I GG awk ' \' ' BEGIN {print \"#included GG;\" } {print} ' \' ' GG "
427+ #cmd = "ls -1 " $2 " 2>/dev/null | xargs -I {} awk ' \' ' BEGIN {print \"#included {};\" } {print} ' \' ' {} "
428+
429+
430+ cmd = "ls -1 " $2 " 2>/dev/null | xargs -I {} awk ' \' ' BEGIN {print \"#included-begin {};\" } {print} END{ print \"#included-end {};\" } ' \' ' {} "
431+
432+ # print cmd
433+ system(cmd)
434+
410435 print ""
411436
412437 next
@@ -430,7 +455,7 @@ __process_include() {
430455
431456__process_format (){
432457 cat /dev/stdin | awk -v NGINX_CONFIG=" $NGINX_CONFIG :" ' {
433- gsub("import", "include")
458+ # gsub("import", "include")
434459 # print NGINX_CONFIG $0
435460 print $0
436461 }'
0 commit comments