Solved

Sed into FSTAB

Posted on 2011-03-16
4
508 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
[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
  • 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux Hosting 16 105
Permission on folders 6 35
Zimbra and Renewing SSL Certficate 9 60
linux convert text file to PDF 7 71
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

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