Question:
I have to cycle over the files present in a folder but I dont want to cycle over files with a specific pattern (“Reverse”). Here is the codeThanks
Answer:
Yourawk
command puts spaces $b
, so $outputDirs
will contain spaces. Therefore, you need to quote it to make it a single argument to printf
. You should also quote all the other variable arguments.Also, since you’re creating a
perl
command line, you’ll want outdir=%s
to be a single argument, so you should put single quotes around that as well.Reverse
in the name, enable extended globbing and use a non-matching pattern.If you have better answer, please add a comment about this, thank you!