[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bash Scripting



On Tue, Jan 30, 2001 at 10:02:38PM +0100, Matthias Wieser wrote:
| William Leese wrote:
| .... 
| > sed  's/Title/$TITLE/g' title.html >> file.txt &&
         ^                ^
The single quotes are a problem too.  Bash doesn't do any variable
expansion in single quotes.  ($TITLE will still be $TITLE for sed)

Instead:

sed  "s/Title/$TITLE/g" title.html >> file.txt &&

Also, I'm not sure why you have double & at the end of the line.  I
think you want to run sed in the foreground, not the background.  I
don't understand what the second & does.

| I think the g is missing, that is all I noticed

You only need the g if the text to replace occurs more than once on a
line.  If it doesn't, it doesn't matter.  If it does, do you want to
replace all occurences or just the first?

| 
| Ciao, mattHias
| 
| -- 


BTW,  I don't use bash scripting for anything other than running
programs with some default options.  I would prefer to use python for
this sort of thing, but it's up to you what you want to use.

-D



Reply to: