Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sed into FSTAB

Posted on 2011-03-16
4
Medium Priority
?
516 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 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
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

782 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