Solved

sed solaris issue?

Posted on 2011-03-08
2
541 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 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Find characters between pattern in a file linux 3 50
Unix Command -- Challenging  question 7 105
Need to combine two scripts 2 52
[bash] complex parsing 9 34
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
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…

734 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