[Gllug] little bash/sed scripting problem

Craig Millar craig at SHAPERO.com
Fri May 21 08:37:28 UTC 2004


Simon Jakesch wrote:
> 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"

Try this:
echo `sed -e 's/$2/$3/' temp.temp > $FILE`
echo `rm -f temp.temp`
Note the backquotes (or whatever they are called). Otherwise, you will 
just be echoing the line in quotes. This will then echo the results to 
the screen.

Craig
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list