murkytuna
asked on
running topasout on multiple files and creating new files with a .out extension
What would be a command or script to select all the *.topas files, run this command on them: topasout -R detailed -i 5 *.topas and create new files with the same name as the .topas files only with .out at the end of the filename instead of .topas.
Example:
topasout -R detailed -i 5 servername_cec_100324.topa s > servername_cec_100324.out
topasout -R detailed -i 5 servername_cec_100325.topa s > servername_cec_100325.out
topasout -R detailed -i 5 servername_cec_100326.topa s > servername_cec_100326.out
So, iinstead of doing those commands manually, one by one, would it be possible to select all the .topas files, run that command on them and create new .out files with the same name as the .topas files only with .out instead of .topas at the end?
Example:
topasout -R detailed -i 5 servername_cec_100324.topa
topasout -R detailed -i 5 servername_cec_100325.topa
topasout -R detailed -i 5 servername_cec_100326.topa
So, iinstead of doing those commands manually, one by one, would it be possible to select all the .topas files, run that command on them and create new .out files with the same name as the .topas files only with .out instead of .topas at the end?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Whew. Thanks much!
ls *.topas | while read file
do
topasout -R detailed -i 5 $file > ${file%".topas}.out
done
wmp