[PLUG] another bash question
Richard Kurth
rkurth at starband.net
Tue Aug 6 20:47:38 UTC 2002
Hello Shannon,
Tuesday, August 06, 2002, 1:18:56 PM, you wrote:
SCD> On Tue, 6 Aug 2002, Richard Kurth wrote:
SCD> [snip]
>> I changed it to look like this
>> A=$(uname -n)
>> sed -e '/ServerName localhost/c\
>> ServerName "$A"\ #<-I added the double quotes
>> ' < httpd.conf
>>
>> And this is what it looks like when it writes to the httpd.conf file
>> ServerName "$A"
>> It is not filling in the variable with what is in the variable.
SCD> You need it around the whole string, replace your single quotes with
SCD> double quotes, the problem is the single quotes which supress
SCD> interpretation of the contents of the string between them. In other
SCD> words, this:
SCD> sed -e "/ServerName localhost/c\
SCD> ServerName $A\
SCD> " < httpd.conf
Ok I changed it to look Like this
A=$(uname -n)
sed -e "/ServerName localhost/c\
ServerName $A\
" < httpd.conf
and this is the error I get now
sed: -e expression #1, char 24: Extra characters after command
SCD> _______________________________________________
SCD> PLUG mailing list
SCD> PLUG at lists.pdxlinux.org
SCD> http://lists.pdxlinux.org/mailman/listinfo/plug
--
Best regards,
Richard mailto:rkurth at starband.net
More information about the PLUG
mailing list