[Nottingham] A little scripting on a Sunday evening (help please)

Michael Simms michael at linuxgamepublishing.com
Sun Apr 9 20:17:44 BST 2006


On Sun, 2006-04-09 at 20:03 +0100, Joshua Lock wrote:

> That would do it if not for the spaces in file names...
> After a quick man find I thought adding -print0 might help, alas no...

Ewwww bad webbie, no biscuit - to your friend with the spaces in
filenames

OK, do make doit.sh do

#!/bin/sh -

cat "$1" | sed -e "s/\.html/\.php/g" > /tmp/fixing
mv /tmp/fixing "$1"

newname=`echo $1 | sed -e "s/html$/php/"`

mv "$1" "$newname"

> >
> >> I'm not asking someone to write such a script for me (although I
> >> would gratefully and gladly accept and existing solution);
> >
> > You caught me in between jobs {:-) Shell scripting is fun and it  
> > sounded
> > like a good 5 minute challenge and indeed it was {:-)
> 
> Dost thou never stop working young Michael?

Nope, not till I die {:-)

> I appreciate you taking the time :)

I love shell scripting, call me a masochist {:-) Yer welcome {:-)

-- 
Michael Simms - CEO, Linux Game Publishing
http://www.linuxgamepublishing.com



More information about the Nottingham mailing list