?
Solved

sed solaris issue?

Posted on 2011-03-08
2
Medium Priority
?
544 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
Maciej S earned 2000 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

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

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Utilizing an array to gracefully append to a list of EmailAddresses
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses
Course of the Month9 days, 17 hours left to enroll

762 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