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.topas > servername_cec_100324.out
topasout -R detailed -i 5 servername_cec_100325.topas > servername_cec_100325.out
topasout -R detailed -i 5 servername_cec_100326.topas > 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?
murkytunaAsked:
Who is Participating?
 
woolmilkporcConnect With a Mentor Commented:
... sorry, missed one double quote following topas -
ls *.topas | while read file
  do
    topasout -R detailed -i 5 $file > ${file%".topas"}.out
  done  
0
 
woolmilkporcCommented:
Hi,
ls *.topas | while read file
  do
    topasout -R detailed -i 5 $file > ${file%".topas}.out
  done
wmp
0
 
murkytunaAuthor Commented:
Whew.  Thanks much!
0
All Courses

From novice to tech pro — start learning today.