1834665 Members
2534 Online
110069 Solutions
New Discussion

problems with sed

 
Devin McEntee
Occasional Contributor

problems with sed

I'm trying to implement a generic backup script from Oracle press and it used sed at various points; but the sed commands don't work. I don't know if there are any hp/ux variations that could be causing my problems. Example follows:

file $DBBACKUP contains 9 lines of filename & tablespace name.

SED="sed -e '/selected\.$/d' -e '/^---.*--$/d' -e '/^FILE_NAME/d' $DBBACKUP"

eval $SED | while read FILE TABLESPACE
do

The statements inside the do don't get executed.

Thanks


2 REPLIES 2
harry d brown jr
Honored Contributor

Re: problems with sed

Devin, can you post the file? it would help, so we can see how and waht you are matching to.

live free or die
harry
Live Free or Die
Joseph C. Denman
Honored Contributor

Re: problems with sed

Devin,

Harry is right, it is hard to tell from what you have given us.

The portion you provided looks good? Have you tried running from the command line?

Attempt to run the sed from the command line.

sed -e '/selected\.$/d' -e '/^---.*--$/d' -e '/^FILE_NAME/d' /the/dbbackup/file

If you get nothing back, that is why the do is doing nothing.


Hope this helps.

...jcd...

If I had only read the instructions first??