Prev: Want to insert some stuff as a new line after the line matchingregexp.
Next: Bulk moving of files
From: moonhkt on 23 Mar 2010 02:50 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 23 Mar 2010 03:23 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 23 Mar 2010 04:32 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 23 Mar 2010 08:57 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 23 Mar 2010 09:47 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.
|
Next
|
Last
Pages: 1 2 3 Prev: Want to insert some stuff as a new line after the line matchingregexp. Next: Bulk moving of files |