f



sed replace text Question

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
0
moonhkt (146)
3/23/2010 6:50:12 AM
comp.unix.shell 15484 articles. 3 followers. Post Follow

13 Replies
1288 Views

Similar Articles

[PageSpeed] 52

On 2010-03-23, moonhkt <moonhkt@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@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
0
Seebs
3/23/2010 7:23:25 AM
On 3=E6=9C=8823=E6=97=A5, =E4=B8=8B=E5=8D=883=E6=99=8223=E5=88=86, Seebs <u=
senet-nos...@seebs.net> wrote:
> On 2010-03-23, moonhkt <moon...@gmail.com> wrote:
>
> > System : AIX 5.3
>
> Why?
>
> > How to using sed replace =C2=A0'/* testing_email_body.txt */' =C2=A0to =
'UNIX
> > SILENT cat /phx/src/testing_email_body.txt \> VALUE(tmp-file1).' ?
>
> Have you ever considered getting a book on shell programming? =C2=A0It re=
ally
> 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. =C2=A0You could also learn how the tools work, and then it would be
> obvious.
>
> -s
> --
> Copyright 2010, all wrongs reversed. =C2=A0Peter Seebach / usenet-nos...@=
seebs.nethttp://www.seebs.net/log/<-- lawsuits, religion, and funny picture=
shttp://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

I tried to handle those Metacharacters this morning, but failure to
handle those character.
0
moonhkt
3/23/2010 8:32:59 AM
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.
0
Thomas
3/23/2010 12:57:32 PM
On 3/23/2010 3:32 AM, moonhkt wrote:
> On 3月23日, 下午3時23分, Seebs<usenet-nos...@seebs.net>  wrote:
>> On 2010-03-23, moonhkt<moon...@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...@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.
0
Ed
3/23/2010 1:47:56 PM
On 2010-03-23, moonhkt <moonhkt@gmail.com> wrote:
> I tried to handle those Metacharacters this morning, but failure to
> handle those character.

That's nice.

Tell you what.

You demonstrate to me that you've read ESR's "how to ask questions", and
that you comprehend it, and I'll answer your question.

Otherwise, please stop wasting everyone's time by refusing to even think.

Hint:  "failure to handle" is uninformative.  We don't know what you tried,
or how it failed, or even why you think what happened was a failure.

-s
-- 
Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nospam@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
0
Seebs
3/23/2010 5:10:33 PM
On 3=E6=9C=8824=E6=97=A5, =E4=B8=8A=E5=8D=881=E6=99=8210=E5=88=86, Seebs <u=
senet-nos...@seebs.net> wrote:
> On 2010-03-23, moonhkt <moon...@gmail.com> wrote:
>
> > I tried to handle those Metacharacters this morning, but failure to
> > handle those character.
>
> That's nice.
>
> Tell you what.
>
> You demonstrate to me that you've read ESR's "how to ask questions", and
> that you comprehend it, and I'll answer your question.
>
> Otherwise, please stop wasting everyone's time by refusing to even think.
>
> Hint: =C2=A0"failure to handle" is uninformative. =C2=A0We don't know wha=
t you tried,
> or how it failed, or even why you think what happened was a failure.
>
> -s
> --
> Copyright 2010, all wrongs reversed. =C2=A0Peter Seebach / usenet-nos...@=
seebs.nethttp://www.seebs.net/log/<-- lawsuits, religion, and funny picture=
shttp://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

Try This morning . OK

#!/bin/ksh
# 2010/03/22

hostname=3D`hostname`

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

# Change Program
echo Search "$SER_LINE"
echo Replace "$REP_LINE"
echo file
sed "s:${SER_LINE}:${REP_LINE}:g" abc.p  > a.txt
#sed 's/mail/kk/g' abc.p
0
moonhkt
3/24/2010 8:12:46 AM
moonhkt <moonhkt@gmail.com> writes:

>
> Try This morning . OK
>
> #!/bin/ksh
> # 2010/03/22
>


> hostname=`hostname`
>
> case "$hostname" in
>    phxdev2|phxdev3|phxdev4|phxdev5 )    ;;
>    *) echo "This script for phxdev2,3,4 and 5 only "
>       exit  ;;
> esac


Why did you include this part? 

It is obvious that it has nothing to do with the problem, and than if
we keep it in, the script WILL NOT WORK!


> FN=/phx/src/testing_email_body.txt


And this file DOES NOT EWXIST!


> 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"
>

And this has nothing to do with your problem


> # Change Program
> echo Search "$SER_LINE"
> echo Replace "$REP_LINE"
> echo file
> sed "s:${SER_LINE}:${REP_LINE}:g" abc.p  > a.txt
> #sed 's/mail/kk/g' abc.p

Where is file abc.p?

We help because we want to. And many of us are very busy, just like you are.
You are being inconsiderate and lazy. 

You should be ashamed of your actions for posting such terrible examples.


Now here is an example of hat you should have posted.

#!/bin/ksh
SER_LINE='\/\* testing_email_body.txt \*\/'
REP_LINE='UNIX SILENT cat /phx/src/testing_email_body.txt > VALUE(tmp-file1).'

echo '/* testing_email_body.txt */'| sed "s:${SER_LINE}:${REP_LINE}:g" 

---------------------
and that works fine.

When I  run the  script, using bash I get
UNIX SILENT cat /phx/src/testing_email_body.txt > VALUE(tmp-file1).

whis is as far as I can tell, what you want to get.








0
Maxwell
3/24/2010 11:39:34 AM
On 2010-03-24, moonhkt <moonhkt@gmail.com> wrote:
> On 3?24?, ??1?10?, Seebs <usenet-nos...@seebs.net> wrote:
>> You demonstrate to me that you've read ESR's "how to ask questions", and
>> that you comprehend it, and I'll answer your question.

>> Hint: �"failure to handle" is uninformative. �We don't know what you tried,
>> or how it failed, or even why you think what happened was a failure.

> Try This morning . OK

Not even close.

Read the above.  Again.

You need to say:
1.  What you were trying to do.
2.  What you wanted it to do.
3.  What actually happened.
4.  Why you think this is a problem.

You have told us NONE of the above, you've just handed us a hunk of
code.  The code has no explanation of what the intended behavior is,
and has commented-out bits suggesting that it's not really very well
understood.

Here, let me show you what an actual question would look like:

	I have the following input file:
		kitty
	I would like to process this and create a file like this:
		puppy
	Here is my first attempt.  When I run this, instead of
	creating a file which contains the word "puppy", it creates
	a file which reads "idiot".  What should I change to do that?

	#!/bin/sh
	sed -e 's/kitty/idiot/' < input > output

Note how I clearly state what I have as input, giving an explicit and exact
example of it, not a vague handwaving description.  Note how I also clearly
show what the output would look like.  I also explain what I actually get
when I run my script.

It would be very easy for someone to answer this question, because I've given
the reader enough information to do something with it.

You haven't.  Furthermore, I've explained more than once what you need to
do in order to get better answers, and you've ignored it.

You get one more try before I give up, killfile you, and stop trying to help.
I'm glad to help people who are willing to make a reasonable effort to explain
what they need help with.  If you're not willing to give me enough information
to make it *possible* for me to help you (because I still have no idea what
your problem is), then it's not worth it for me to spend time guessing wildly.

-s
-- 
Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nospam@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
0
Seebs
3/24/2010 10:31:48 PM
On 3=E6=9C=8825=E6=97=A5, =E4=B8=8A=E5=8D=886=E6=99=8231=E5=88=86, Seebs <u=
senet-nos...@seebs.net> wrote:
> On 2010-03-24, moonhkt <moon...@gmail.com> wrote:
>
> > On 3?24?, ??1?10?, Seebs <usenet-nos...@seebs.net> wrote:
> >> You demonstrate to me that you've read ESR's "how to ask questions", a=
nd
> >> that you comprehend it, and I'll answer your question.
> >> Hint: =C2=A0"failure to handle" is uninformative. =C2=A0We don't know =
what you tried,
> >> or how it failed, or even why you think what happened was a failure.
> > Try This morning . OK
>
> Not even close.
>
> Read the above. =C2=A0Again.
>
> You need to say:
> 1. =C2=A0What you were trying to do.
> 2. =C2=A0What you wanted it to do.
> 3. =C2=A0What actually happened.
> 4. =C2=A0Why you think this is a problem.
>
> You have told us NONE of the above, you've just handed us a hunk of
> code. =C2=A0The code has no explanation of what the intended behavior is,
> and has commented-out bits suggesting that it's not really very well
> understood.
>
> Here, let me show you what an actual question would look like:
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 I have the following input file:
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 kitty
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 I would like to process this and create a fil=
e like this:
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 puppy
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 Here is my first attempt. =C2=A0When I run th=
is, instead of
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 creating a file which contains the word "pupp=
y", it creates
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 a file which reads "idiot". =C2=A0What should=
 I change to do that?
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 #!/bin/sh
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 sed -e 's/kitty/idiot/' < input > output
>
> Note how I clearly state what I have as input, giving an explicit and exa=
ct
> example of it, not a vague handwaving description. =C2=A0Note how I also =
clearly
> show what the output would look like. =C2=A0I also explain what I actuall=
y get
> when I run my script.
>
> It would be very easy for someone to answer this question, because I've g=
iven
> the reader enough information to do something with it.
>
> You haven't. =C2=A0Furthermore, I've explained more than once what you ne=
ed to
> do in order to get better answers, and you've ignored it.
>
> You get one more try before I give up, killfile you, and stop trying to h=
elp.
> I'm glad to help people who are willing to make a reasonable effort to ex=
plain
> what they need help with. =C2=A0If you're not willing to give me enough i=
nformation
> to make it *possible* for me to help you (because I still have no idea wh=
at
> your problem is), then it's not worth it for me to spend time guessing wi=
ldly.
>
> -s
> --
> Copyright 2010, all wrongs reversed. =C2=A0Peter Seebach / usenet-nos...@=
seebs.nethttp://www.seebs.net/log/<-- lawsuits, religion, and funny picture=
shttp://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

Thank for your suggestion. Keep the coding sample and provide more
information .
I am not lazy. I try and search before post. May be I am not a good
script writter.
0
moonhkt
3/25/2010 4:51:59 AM
On 2010-03-25, moonhkt <moonhkt@gmail.com> wrote:
> Thank for your suggestion. Keep the coding sample and provide more
> information .

Yes.

> I am not lazy. I try and search before post.

But you don't actually spend the thirty seconds it would take to tell
us what you actually want to have your script do!

> May be I am not a good
> script writter.

You're certainly not very good at asking questions.  Again, I urge
you to read ESR's document on how to ask questions the smart way.

-s
-- 
Copyright 2010, all wrongs reversed.  Peter Seebach / usenet-nospam@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
0
Seebs
3/25/2010 5:37:34 AM
Mon, 22 Mar 2010 23:50:12 -0700, moonhkt did cat :

> 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).' ?

from the few bits I could read in the curious stuff you posted
I happend to conceive that maybe this is what you asked for:
$ sed 's:/\* testing_email_body.txt \*/:UNIX SILENT cat /phx/src/testing_email_body\.txt \\> VALUE(tmp-file1)\.:' yourfile>yournewfile
0
Loki
3/25/2010 3:22:41 PM
In article <01ddc941-274a-4178-8f3b-d7c2ece8cee2@w39g2000prd.googlegroups.com>,
moonhkt  <moonhkt@gmail.com> wrote:
>Hi All
>
>System : AIX 5.3
>
>
>How to using sed.....

Get the book "Sed & Awk"  <http://www.ora.com>

*READ* IT.  two or three times.

It contains everything you'll need to know about 'regular expressions' and
text subsitution.

You'll be amazedat the magic you'll be able to perform, _without_help. :)




0
bonomi
3/25/2010 11:24:46 PM
On 3=E6=9C=8826=E6=97=A5, =E4=B8=8A=E5=8D=887=E6=99=8224=E5=88=86, bon...@h=
ost122.r-bonomi.com (Robert Bonomi) wrote:
> In article <01ddc941-274a-4178-8f3b-d7c2ece8c...@w39g2000prd.googlegroups=
..com>,
>
> moonhkt =C2=A0<moon...@gmail.com> wrote:
> >Hi All
>
> >System : AIX 5.3
>
> >How to using sed.....
>
> Get the book "Sed & Awk" =C2=A0<http://www.ora.com>
>
> *READ* IT. =C2=A0two or three times.
>
> It contains everything you'll need to know about 'regular expressions' an=
d
> text subsitution.
>
> You'll be amazedat the magic you'll be able to perform, _without_help. :)

Thank for your provided the link to me.
0
moonhkt
4/1/2010 5:14:34 PM
Reply:

Similar Artilces:

Question using sed replace text file \t
Hi All System AIX 5.3 @ office /Cygwin @ home Where RT is New Order number, I want replace "123" to new order number. For testing third party program. How to handle regular expression. Now,I am build some testing file. When RT have \t ,(some text fields need to add special/meta character on it. ) then add two \\ before it. But using sed, the result is not ok, a <tab> found between = and {. I expected is \t . Do you know what problem ? #!/bin/ksh # 2010/04/22 FN=abc.txt FSED=abc.sed # Add Backslash for & / # Add backslash for $?,$#,$$,$@ # escape se...

web hosting, shell provider, unix shells, bnc shell, ircd provider, shell hosting, bnc shells, irc shells, ircd shells, unix shell account, irc shell, irc, eggdrop shell, irc vps, irc shell, linux vps
http://www.hostrazor.net/ web hosting, shell provider, unix shells, bnc shell, ircd provider, shell hosting, bnc shells, irc shells, ircd shells, unix shell account, irc shell, irc, eggdrop shell, irc vps, irc shell, linux vps -- questo articolo e` stato inviato via web dal servizio gratuito http://www.newsland.it/news segnala gli abusi ad abuse@newsland.it ...

Sed: Replace text in one file with SPECIFIC text from another
Hi all, I'm trying to take a dhcpd.conf file and replace each IP address in it with a host name. The address-to-hostname map is in hosts. This is what I've got so far: sed -e '/\([0-9]\{1,3\}[.]\)\{3\}[0-9]\{1,3\}/R hosts' dhcpd.conf So far, this appends a single line from hosts to the matched line in dhcpd.conf, here is sample output: fixed-address 192.168.1.81; 192.168.1.92 term012 The first line is from dhcpd.conf and the second is from hosts. However, I have not been able to figure out how to append the appropriate line; at the moment, it's goin...

Sed and replacing text
Hi All I am trying to change the text "root" from a file to "#root". When i am running the following command on the prompt but without redirection it is displaying the correct output on the terminal. But when i redirect the output to the same file the file loses all its contents. Pls help. sed '1,$s/root/#root/' /etc/ftpd/ftpusers > /etc/ftpd/ftpusers Thanks Manish. manish wrote: > Hi All > > I am trying to change the text "root" from a file to "#root". When i am > running the following command on the prompt but without red...

Sed replacing question
How do I use sed to "replace everything except, say, "google" in a stream"? I.e. the whole thing must go through unchanged, with all instances of "google" being changed to, say "froogle". Thanks much. binary-nomad@hotmail.com wrote: > How do I use sed to "replace everything except, say, "google" in a > stream"? > > I.e. the whole thing must go through unchanged, with all instances of > "google" being changed to, say "froogle". Your first sentence said you want to change everything EXCEPT &qu...

Replace text block with sed?
I'm trying to perform a simple find and replace with sed, but it's making my head hurt. I need to locate the following block in a text file: [ req ] default_bits = 1024 default_keyfile = privkey.pem distinguished_name = req_distinguished_name attributes = req_attributes x509_extensions = v3_ca dirstring_type = nobmp [ req_distinguished_name ] countryName = Country Name (2 letter code) countryName_default = AU countryName_min = 2 countryName_max = 2 localityName = Locality Name (eg, city) organizationalUnitName = Organizational Unit Name (eg, section) commonName = Com...

UNIX shell script question
I try with a UNIX shell script to do some actions in each subdirectories. Here is my script: #!/bin/sh DIRS=`ls -Q` for userdir in $DIRS do #do some action on each dir echo $userdir done My problem is that I have directories with whitespaces in their name. For example I have the following directories: test 1 test 2 test 3 test 4 I get the following output: "test 1" "test 2" "test 3" "test 4" I would expect the following: "test 1" "test 2" "test 3" "test 4" In the variable DIRS I get the fol...

Sed replacing question (repeat again!)
Hello, Sorry about the last 2 times, this is the Third (and final) post on the subject, trust me! :) OK, my problem is: I want everything except "dog" Filtered Out of a stream, e.g., if this is the stream: beartracks catpoo snakepiss doghair (they'll be separated with a newline or something similar), I want - "dog". So, first, everything Except "dog" has to be replaced with a blank, and then a s/doghair/dog has to be done, yes? Is there any expression which will cut out "hair" from "doghair" automatically? (er, in the actual thing...

Sed replacing question (repeat)
Apologies for last time, I realise now that I worded the question in an ambiguous way. For those who are wondering, I meant the first one! For those reading this for the first time: how do I use sed to do a "replace everything except "foo"", in a stream? binary-nomad@hotmail.com wrote: > Apologies for last time, I realise now that I worded the question in an > ambiguous way. For those who are wondering, I meant the first one! > > For those reading this for the first time: how do I use sed to do a > "replace everything except "foo"", ...

Question about unix shell accounts
What is the cheapest unix shell account for getting online via the Commodore? Are there any good, free shell accounts that permit dialup access? I've looked at both Iglou.com and Eskimo.com. I think one charges $15 a month (not sure). Do free ones exist? Or ones that accept one-time fees and then are free? Paul dunric@yahoo.com wrote: > What is the cheapest unix shell account for getting online via the > Commodore? Are there any good, free shell accounts that permit dialup > access? > > I've looked at both Iglou.com and Eskimo.com. I think one charges $15 a > mo...

Newbie question on replace-eval-replacement , replace-quote
While searching in groups, I came across the following discussion. http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/c723bde021ea8183/a2afe24ce98ed739?lnk=gst&q=%22\%2C%22+swap#a2afe24ce98ed739 which presents the following code. ,---- | (defun query-swap-regexp (regexp-a regexp-b) | "Swap A and B regexp matches in current buffer or region." | (interactive "sRegexp A: \nsRegexp B: ") | (let ((match-a (save-excursion | (re-search-forward regexp-a nil t) | (match-string 0))) | (match-b (save-excursion | ...

Sed: replacing text with textfile content
Can I use sed to replace a string of text in one file, with the entire contents of another file? I keep on running into problems with special characters....even when I use characters that don't occur in the HTML. :-( cat "${TEMPLATE}" | \ sed "s@<!--#include VIRTUAL=\"ssi/css\"-->@`cat ~/public_html/ssi/css`@g" > \ "${OUTFILE}" In this case, I want to replace the following text in the template: <!--#include VIRTUAL="ssi/css"--> With the entire contents of ~/public_html/ssi/css, before writing the output to a sep...

2 questions about UNIX sed command
This is a UNIX command line that I can execute: cat file_old.txt | sed 's/string_A/string_B/g' | sed 's@, .\\VDD: (VDD)@@g' > file_new.txt #sed 's/string_C/string_D/g' Questions: 1. What the function of this? -- sed 's@, .\\VDD: (VDD)@@g' 2. What does this mean? -- #sed 's/string_C/string_D/g' Note that this is already after the output file name. It's in the same line with the command. This page is not wide enough, so it appears to be on the next line. And what's the function of # in this command? Thanks. On Nov 30, 6:57 am, chen_zhi.....

a question abt sed .. seek and replace
hi i am generally new to sed and awk but had to use them. i am tryin to global replace from standard input like RSLT=`sed -i "s/${REPL}/${WITH}/g" ${FILE_NAME} ` now i wanna replace the ${REPL} and the next 7 lines with blank means basically wanna delete starting from ${REPL} to next 7 lines .... any suggestions .... Cheers IronMonk wrote: > hi i am generally new to sed and awk but had to use them. > > i am tryin to global replace from standard input like > > RSLT=`sed -i "s/${REPL}/${WITH}/g" ${FILE_NAME} ` > > now i wanna replace the ...

Web resources about - sed replace text Question - comp.unix.shell

West Lothian question - Wikipedia, the free encyclopedia
He illustrated his point by pointing out the absurdity of a Member of Parliament for West Lothian being able to vote on matters affecting the ...

First Hill Streetcar launch party planned — only question is when — UPDATE: SATURDAY SOFT LAUNCH
As of last Wednesday, Seattle Department of Transportation officials have a plan for the event to launch the First Hill Streetcar including a ...


Five Brainless Job Interview Questions That Need To Die
Liz Ryan lays out five stupid and pointless job-interview questions whose time has passed

Woman questions husband's shooting by Phoenix-area police
A Texas woman is questioning what led suburban Phoenix police to fatally shoot her unarmed husband at a hotel.

New series ‘Dark Net’ raises questions about tech’s hidden side
Many of us have a love/hate relationship with the role technology plays in our lives. We adore our mobile devices, our favorite apps, and websites, ...

Exhibit of Bill Cosby's Art Led to Ethical Questions
A Smithsonian exhibit funded by Bill Cosby and his wife that showcases art from their private collection led to questions about the cultural ...

Quick Question: Can You Still Get A Car With A Non-Black B-Pillar?
I’m not exactly sure when it happened, but at some point in the world of auto design, we all just seemed to agree that the B-pillar was a shameful, ...

Study questions link between teen pot smoking and IQ decline
Albuquerque’s source for local news and live streaming video online. KRQE reports on news, weather, traffic, investigations and sports for New ...

Vogue Asks Derek Zoolander 73 Questions While Visiting His Really, Really Ridiculously Good-Looking Apartment ...
Host Joe Sabia of Vogue recently asked Derek Zoolander ( Ben Stiller ) 73 questions while taking an interesting tour of Zoolander’s “really, ...

Resources last updated: 1/24/2016 6:16:25 AM