From: moonhkt on
Hi All

System : AIX 5.3


How to using sed replace '/* testing_email_body.txt */' to 'UNIX
SILENT cat /phx/src/testing_email_body.txt \> VALUE(tmp-file1).' ?

program file
cat abc.p
/* testing_email_body.txt */

#!/bin/ksh
hostname=`hostname`

case "$hostname" in
phxdev2|phxdev3|phxdev4|phxdev5 ) ;;
*) echo "This script for phxdev2,3,4 and 5 only "
exit ;;
esac
FN=/phx/src/testing_email_body.txt
SER_LINE='/* testing_email_body.txt */'
REP_LINE='UNIX SILENT cat /phx/src/testing_email_body.txt \> VALUE(tmp-
file1).'
#SER_LINE='mail'
#REP_LINE='kk'
echo "This email is sent from phx Development Server ("$hostname").
Please ignore this testing email. Thanks !
" > "$FN"

# Change Program
echo "$SER_LINE"
echo "$REP_LINE"
echo file
sed "s/${SER_LINE}/${REP_LINE}/g" abc.p
#sed 's/mail/kk/g' abc.p
From: Seebs on
On 2010-03-23, moonhkt <moonhkt(a)gmail.com> wrote:
> System : AIX 5.3

Why?

> How to using sed replace '/* testing_email_body.txt */' to 'UNIX
> SILENT cat /phx/src/testing_email_body.txt \> VALUE(tmp-file1).' ?

Have you ever considered getting a book on shell programming? It really
seems as though you have a lot of questions that would be answered
much faster by reading a book and thinking about things.

You don't have to ask experts for a magical recipe for each specific
task. You could also learn how the tools work, and then it would be
obvious.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam(a)seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
From: moonhkt on
On 3月23日, 下午3時23分, Seebs <usenet-nos...(a)seebs.net> wrote:
> On 2010-03-23, moonhkt <moon...(a)gmail.com> wrote:
>
> > System : AIX 5.3
>
> Why?
>
> > How to using sed replace  '/* testing_email_body.txt */'  to 'UNIX
> > SILENT cat /phx/src/testing_email_body.txt \> VALUE(tmp-file1).' ?
>
> Have you ever considered getting a book on shell programming?  It really
> seems as though you have a lot of questions that would be answered
> much faster by reading a book and thinking about things.
>
> You don't have to ask experts for a magical recipe for each specific
> task.  You could also learn how the tools work, and then it would be
> obvious.
>
> -s
> --
> Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nos...(a)seebs.nethttp://www.seebs.net/log/<-- lawsuits, religion, and funny pictureshttp://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

I tried to handle those Metacharacters this morning, but failure to
handle those character.
From: Thomas 'PointedEars' Lahn on
moonhkt wrote:

> Seebs wrote:
>> moonhkt wrote:
>> > System : AIX 5.3
>>
>> Why?

Why not?

>> > How to using sed replace '/* testing_email_body.txt */' to 'UNIX
>> > SILENT cat /phx/src/testing_email_body.txt \> VALUE(tmp-file1).' ?
>>
>> Have you ever considered getting a book on shell programming? It really
>> seems as though you have a lot of questions that would be answered
>> much faster by reading a book and thinking about things.
>>
>> You don't have to ask experts for a magical recipe for each specific
>> task. You could also learn how the tools work, and then it would be
>> obvious.
>> [...]
>
> I tried to handle those Metacharacters this morning, but failure to
> handle those character.

So, what exactly have you tried?

<http://www.catb.org/~esr/faqs/smart-questions.html>


PointedEars

P.S.
Please trim your quotes to the relevant minimum, don't quote signatures.
From: Ed Morton on
On 3/23/2010 3:32 AM, moonhkt wrote:
> On 3月23日, 下午3時23分, Seebs<usenet-nos...(a)seebs.net> wrote:
>> On 2010-03-23, moonhkt<moon...(a)gmail.com> wrote:
>>
>>> System : AIX 5.3
>>
>> Why?
>>
>>> How to using sed replace '/* testing_email_body.txt */' to 'UNIX
>>> SILENT cat /phx/src/testing_email_body.txt \> VALUE(tmp-file1).' ?
>>
>> Have you ever considered getting a book on shell programming? It really
>> seems as though you have a lot of questions that would be answered
>> much faster by reading a book and thinking about things.
>>
>> You don't have to ask experts for a magical recipe for each specific
>> task. You could also learn how the tools work, and then it would be
>> obvious.
>>
>> -s
>> --
>> Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nos...(a)seebs.nethttp://www.seebs.net/log/<-- lawsuits, religion, and funny pictureshttp://en.wikipedia.org/wiki/Fair_Game_(Scientology)<-- get educated!
>
> I tried to handle those Metacharacters this morning, but failure to
> handle those character.

Please post what you tried as this is such a simple task that you must have some
fundamental misunderstanding of how to handle metacharacters in a search string
so the only way we can help you with that is to understand where you're going
wrong and if we instead just answer this question then you'll be back asking a
very similar question again soon.

Ed.