Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

sed solaris issue?

Posted on 2011-03-08
2
Medium Priority
?
549 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 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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 …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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

810 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