Solved

sed solaris issue?

Posted on 2011-03-08
2
537 Views
Last Modified: 2012-05-11
I have been used the solution given, it works fine with linux, but not on SOLARIS
can you help with this updated:
sed 's/$DB_NAME:\/export\/oracle\/product\/11.2.0.1:N/$DB_NAME:\/export\/oracle\/product\/11.2.0.2:N/g' /etc/oratab

the answer i was given and looks ok for linux is
sed -i 's/DATABASE:\/export\/oracle\/product\/11.2.0.1:N/DATABASE:\/export\/oracle\/product\/11.2.0.2:N/' /export/oracle/oratab
0
Comment
Question by:radical_mit
2 Comments
 
LVL 23

Accepted Solution

by:
Maciej S earned 500 total points
ID: 35070926
sed 's/.../.../' /export/oracle/oratab > /tmp/oratab.tmp && mv /tmp/oratab.tmp /export/oracle/oratab

sed on solaris doesn't support -i option. You have to use above syntax, or install GNU sed.

You can also make this sed a little bit prettier by using separator other than "/". For example "+":
sed 's+DATABASE:/export/oracle/product/11.2.0.1:N+DATABASE:/export/oracle/product/11.2.0.2:N+' /export/oracle/oratab > /tmp/oratab.tmp \
   && mv /tmp/oratab.tmp /export/oracle/oratab
0
 

Author Closing Comment

by:radical_mit
ID: 35080017
Thanks, that worked 100%
t
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now