Re: a bit more script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



> 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.



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux