1855764 Members
12511 Online
104103 Solutions
New Discussion

to Sridhar: sed again

 
SOLVED
Go to solution
Victor_5
Trusted Contributor

to Sridhar: sed again

Hi Sridhar:

Here is my last post about sed

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x0815ec7c4fc4d5118ff10090279cd0f9,00.html

If I don't want to use temp file for those comment remove and want everything run in memory, how to do so?

Thanks for your reply,
Shawn

3 REPLIES 3
Alan Riggs
Honored Contributor
Solution

Re: to Sridhar: sed again

Not Sridhar, but if I read his script and your file corrctly just change:

for i in `grep -v "=" $FILE`

to

for i in `grep :$ $FILE (if the file has no spaces after the :)

or

for i in `grep -v -e "=" -e "*" $FILE` (if you cannot rely on tight formatting)
Sridhar Bhaskarla
Honored Contributor

Re: to Sridhar: sed again

Shawn,

There are many experts in this forum. So you don't need to ask for a specific person. Moreover, if you post it in general, you may get a far better script than mine.

Alan's is a good way.

You can combine your for statement if you don't want tmp$$ files (Somehow I am used that way)

In the original script replace the "for i"
statement with this..

...
for i in `sed '/^*d/' $FILE |grep -v "="`
do
..

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: to Sridhar: sed again

Small mistake.......sorry.. time to go home.

sed '/^*d/' should be sed '/^*/d'

d should be after 2nd /.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try