View Single Post
  #2 (permalink)  
Old 25-Jun-2009, 06:10
ken_yap ken_yap is online now
Flux Capacitor Penguin
 
Join Date: Jun 2008
Location: GMT+10
Posts: 5,222
ken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud ofken_yap has a reputation to be proud of
Default Re: process multiple files from one command line??

If the shell is bash:

${i/%mts/avi}

will give you the name in $i with the trailing mts changed to avi. The % specifies trailing, without it the first match is used, so you will get a surprise with a name like high-mts.mts.

Oh, and enclose $i and that expression in double quotes so that possible spaces in the filename won't wreck your script.
Reply With Quote