To explain my question I build a small testcase. I have a command that seems to run fine when executed on commandline in windows:
C:\Tools\gawk>echo Hello World|gawk "{ for (i = 1; i <= NF ; i++) printf \"%s\t\", substr($i,1,7); }"
Hello World
However when I do run it in a cmd file it goes wrong:
C:\Tools\gawk>test
C:\Tools\gawk>echo Hello World | gawk "{ for (i = 1; i <= NF ; i++) printf \"s\t\", substr($i,1,7); }"
s s
Anyone who can explain this?
C:\Tools\gawk>echo Hello World|gawk "{ for (i = 1; i <= NF ; i++) printf \"%s\t\", substr($i,1,7); }"
Hello World
However when I do run it in a cmd file it goes wrong:
C:\Tools\gawk>test
C:\Tools\gawk>echo Hello World | gawk "{ for (i = 1; i <= NF ; i++) printf \"s\t\", substr($i,1,7); }"
s s
Anyone who can explain this?