4 ms·
One of the things I like to do with mawk.exe under Windows is to automate the same command over a group of files. Let's say the myPgm only takes one file name
by jftuga 6y ago
One of the things I like to do with mawk.exe under Windows is to automate the same command over a group of files.
Let's say the myPgm only takes one file name as a command line parameter, then I can so something like this:
dir *.xyz /s/b | mawk "{print 'myPgm -x '$0}" | cmd
If the file paths have spaces in them, then you have to wrap the name within double quotes. I have found it challenging to output those in mawk -- at least easily any way. In this case, I have a windows version of tr.exe
In this case, I can do something like this:
dir *.xyz /s/b | mawk "{print 'myPgm -x ~'$0'~'}" | tr ~ \042 | cmd
Although somewhat crude, it is effective.