Ubuntu: Automate a conversion in Wine with BASH (or Python ..)



Question:

There's one Windows program I've to run a few hundred times to convert old files to a new (open!) format. The command is simple:

wine /path/to/foobar.exe -convert /filepath/foobar.ext /filepath/foobar.newext  

The program uses .newext to determine how to convert.

How can I automate this with bash?


Solution:1

I would suggest using a simple for loop:

for i in /file/path/*.ext;  do   wine /path/to/foobar.exe -convert "$i.ext" "${i%.ext}.newext"  done  

It's going to loop into /filepath/ and converts all files with .ext extension to same name with .newext.

Each time it runs wine with for a single file with .ext format.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »