delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/10/06/14:28:31

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Mime-Version: 1.0 (Apple Message framework v734)
In-Reply-To: <017630AA6DF2DF4EBC1DD4454F8EE29706B183D6@rsana-ex-hq1.NA.RSA.NET>
References: <017630AA6DF2DF4EBC1DD4454F8EE29706B183D6 AT rsana-ex-hq1 DOT NA DOT RSA DOT NET>
Message-Id: <18EC6589-78A0-469D-96F0-B30945A5B754@rehley.net>
From: Peter Rehley <peter AT rehley DOT net>
Subject: Re: sed doesnt convert varibale values???
Date: Thu, 6 Oct 2005 11:28:16 -0700
To: "Cygwin List'" <cygwin AT cygwin DOT com>
X-IsSubscribed: yes

On Oct 6, 2005, at 10:57 AM, Maloney, Michael wrote:

>
> I tried it with double-quotes before and it wont accept it:
>
> $ sed "s/weblogic.Server/$APP_SERVER_DOMAIN weblogic.Server/" $file
> sed: -e expression #1, char 22: unknown option to `s'
>
ok, This tells me that APP_SERVER_DOMAIN is getting expanded and  
probably contains some characters that are messing up the sed  
expression.  What is $APP_SERVER_DOMAIN set to.   Just send "echo  
sed ...."
>
> I grabbed a line from a script that works on Solaris (double quotes  
> work
> there):
> sed "s/"$system"_User_email = "$cur_email"/"$system"_User_email =
> "$new_mail"/" $file > ./tmp.txt
>
>
>
> -----Original Message-----
> From: cygwin-owner AT cygwin DOT com [mailto:cygwin-owner AT cygwin DOT com] On  
> Behalf
> Of Peter Rehley
> Sent: Thursday, October 06, 2005 1:41 PM
> To: Cygwin List'
> Subject: Re: sed doesnt convert varibale values???
>
>
> On Oct 6, 2005, at 10:36 AM, Maloney, Michael wrote:
>
>
>>
>> I am using sed and for some reason, it is entering the variable
>> name and
>> not the value to output. The line looks like:
>> sed 's/weblogic.Server/$APP_SERVER_DOMAIN weblogic.Server/' $file
>>
> It's not a sed thing, it's a shell thing.  When you put the
> expression in single quotes, the shell doesn't touch the string, but
> by putting the string in double quotes the shell will parse the
> string before sending it to sed.  This is standard for unix, linux,
> cygwin, etc, etc
>
>>
>> The output looks like:
>> %JAVA_HOME%\bin\java %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS%
>> -Dweblogic.Name=%SERVER
>> _NAME% -Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE%
>> -Djava.security.policy
>> ="%WL_HOME%\server\lib\weblogic.policy" "$APP_SERVER_DOMAIN
>> weblogic.Server"
>>
>> It's just putting the variable name there. I went back an looked at
>> some
>> earlier scripts that I wrote for Unix and the Unix sed worked just
>> as I
>> am trying to do now.
>>
>
>
>> --
>> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>> Problem reports:       http://cygwin.com/problems.html
>> Documentation:         http://cygwin.com/docs.html
>> FAQ:                   http://cygwin.com/faq/
>>
>>
>>
>>
>
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>
>
>


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019