RE: Bash Scripting
On 30-Jan-2001 William Leese wrote:
> hi all
>
> i need a little help on a script. the following scripts function is to merge
> several parts of a html page together and insert a new piece of text from
> text.txt also it has to replace some words (the title, author, submittor, and
> date) with the words given at prompt.
>
> (i'm aware that its crude and basic, but i'm not familar with scripting for
> bash though i'm working through the HOWTO)
>
> the problem is that the variables TITLE AUTHOR SUBMITTOR DATE are not
> replaced with the inputted values, where as FILENAME is so i must have the
> synax wrong the "/"s perhaps?
>
<personal nitpick>
your script is actually a /bin/sh script and uses no special bash features.
</>
$ export FOO="Hi"
$ echo 'bye cruel world!' | sed -e "s/bye/$FOO/"
Hi cruel world!
The problem is you used "'" as your quote char aka single quotes. In shell,
single quote means "pass me along without looking". You want double quotes
like I used.
Reply to: