In the following line The AWK statement parses through a listing for files and outputs the results using the {print} command to the screen. Is there a way to (a) send the output to a file and (b) actually perform a cp cmd to copy the listed files to another directory?
ls | awk -va=$a -vb=$b 'NR>1{x=$9;gsub("[^0-9]","",x);if (x>a&&x<b){print}}'