Link to home
Start Free TrialLog in
Avatar of murkytuna
murkytunaFlag for United States of America

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.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?
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Hi,
ls *.topas | while read file
  do
    topasout -R detailed -i 5 $file > ${file%".topas}.out
  done
wmp
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of murkytuna

ASKER

Whew.  Thanks much!