View Single Post
  #4 (permalink)  
Old 25-Jun-2009, 08:05
microchip8's Avatar
microchip8 microchip8 is offline
Shaman Penguin
 
Join Date: Jun 2008
Location: /dev/belgium
Posts: 2,194
microchip8 is a reputation jewel in the roughmicrochip8 is a reputation jewel in the roughmicrochip8 is a reputation jewel in the roughmicrochip8 is a reputation jewel in the roughmicrochip8 is a reputation jewel in the rough
Default Re: process multiple files from one command line??

Quote:
Originally Posted by ken_yap View Post
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.
or just "${i%.*}.avi"

__________________
My site: http://microchip.bplaced.net
My repo: http://download.opensuse.org/repositories/home:/microchip8
SUSE Unbound Forum: http://suseunbound.lefora.com


Do coders dream of sheep() ?
Reply With Quote