Solved

Sed into FSTAB

Posted on 2011-03-16
4
491 Views
Last Modified: 2012-05-11
Currently, in my fstab file I have this

xxxxxxxxx.xxxxxxxx.com:/vol/cccccccccc_path/path /public/mountpoint nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=120,vers=3,timeo=600       0 0

I need to sed the following xxx5beta

after xxx_xxx_xxx so it looks like this

xxxxxxxxx.xxxxxxxx.com:/vol/cccccccccc_path/path /public/mountpoint nfs rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,actimeo=120,vers=3,timeo=600       0 0

First with a sed script that works gets the points
0
Comment
Question by:jaxstorm
  • 2
  • 2
4 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35148873
sed 's#xxx_xxxxx_xxx#xxx_xxx_xxx/xxxxbeta#' /etc/fstab > fstab.new

If OK:

mv fstab.new /etc/fstab

wmp
0
 
LVL 8

Author Comment

by:jaxstorm
ID: 35148946
I need to write to /etc/fstab directly - this'll be as part of an RPM
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 35148971
sed -i 's#xxx_xxxxx_xxx#xxx_xxx_xxx/xxxxbeta#' /etc/fstab

wmp
0
 
LVL 8

Author Closing Comment

by:jaxstorm
ID: 35150114
Perfect
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

747 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

12 Experts available now in Live!

Get 1:1 Help Now