Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sed into FSTAB

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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

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.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

704 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