[Gllug] perl script

Stig Brautaset stigbrau at start.no
Thu Aug 22 12:54:29 UTC 2002


* Philippe Rousselot <linux at rousselot.org> spake thus:
> Hi,
> 
> I need to modify the title of several files and would like to run a script
> I need to invert letter 1 with letter 4 and letter 2 with letter 5
> 
> 01_02_03_04.jpeg becomes 02_01_03_04.jpeg
> 
> 
> #!/bin/bash
> for i in *jpeg
> do
> rename ???????
> done

for i in *.jpg ; do mv $i `echo $i | sed 's/\([^_]\+\)_\([^_]\+\)/\2_\1/'` ; done

Stig

-- 
brautaset.org

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list