[Nottingham] A little scripting on a Sunday evening (help please)
Joshua Lock
incandescant at gmail.com
Sun Apr 9 20:49:04 BST 2006
On 9 Apr 2006, at 20:17, Michael Simms wrote:
> 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
I'll ensure he doesn't receive any biscuits, though he is about as
far from being a webbie as you get ...
> 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"
Thats that, phase two here I go.
> [snip]
>>
>> Dost thou never stop working young Michael?
>
> Nope, not till I die {:-)
Fair...
>> I appreciate you taking the time :)
>
> I love shell scripting, call me a masochist {:-) Yer welcome {:-)
Masochist or not, thanks :)
And thanks to Roger, Dean and Andy too! :)
Best,
J
More information about the Nottingham
mailing list