[Gllug] little bash/sed scripting problem

Alain Williams addw at phcomp.co.uk
Thu May 20 18:25:12 UTC 2004


On Thu, May 20, 2004 at 02:10:50PM -0400, Simon Jakesch wrote:
> Hi,
> 
> I have a quick question someone should be able to help me
> with fairly quickly. Basically if I execute the bashscript
> below sed doesn't seem to be executed. However if I run the
> sed command line in a normal shell it works (so the syntax
> is correct). Why is it that sed isn't executing fro within
> this script?
> 
> 
> 
> #!/bin/bash
> FILE=EventDatabaseListener.xml
> cp $FILE temp.temp
> echo "sed -e 's/$2/$3/' temp.temp > $FILE"
> echo "rm -f temp.temp"

Should that not be:
	sed -e "s/$2/$3/" temp.temp > $FILE
	rm -f temp.temp

Presumably $2 & $3 are set from the command line invoking the script.


-- 
Alain Williams

#include <std_disclaimer.h>

FATHERS-4-JUSTICE - Campaigning for equal rights for parents and the
best interests of our children. See http://www.fathers-4-justice.org
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list