20 Mar
2012
20 Mar
'12
3:52 p.m.
Thanks to John K Pate but i dont at the moment have time to sit and digest heaps of variables i just need to solve this one problem .
You want to be able to change "img_0004.jpg" to "img_0004_s.jpg", right? You can use the built-in string replace functionality of bash to achieve this (described in the first hit of that google search): $ f=img_0004.jpg $ echo $f img_0004.jpg $ echo ${f/.jpg/_s.jpg} img_0004_s.jpg == John K Pate http://homepages.inf.ed.ac.uk/s0930006/ -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.