Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-10-2008
Registered User
 

Join Date: Mar 2008
Posts: 2
Replace a line in a file with sed

Hi, I am trying to write a script that will replace "PermitEmptyPasswords yes" with "PermitEmptyPasswords no". The following does not seem to work: -

sed 's!/"PermitEmptyPasswords yes"/!/"PermitEmptyPasswords no"/!'

Appreciate any ideas.

Thanks
Sponsored Links
  #2 (permalink)  
Old 03-10-2008
Registered User
 

Join Date: Mar 2008
Posts: 2
Try this.Hopefully this should work

sed 's/PermitEmptyPasswords yes:/PermitEmptyPasswords no/g' file1 > file2
  #3 (permalink)  
Old 03-11-2008
Registered User
 

Join Date: Mar 2008
Posts: 2
Thanks for that Anup, much appreciated.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to replace characters 7 through 14 of every line in a file jakSun8 Shell Programming and Scripting 9 12-13-2007 02:13 AM
How would I replace the 9th character of every line in a file? LordJezo Shell Programming and Scripting 5 09-01-2004 12:51 PM
how to replace a line in a file using shell script cs_sakthi UNIX for Advanced & Expert Users 3 01-27-2002 11:57 PM
In Line File Modifications: Search and Replace Shakey21 Shell Programming and Scripting 2 11-20-2001 04:21 PM
Replace line of text in a file colinchase UNIX for Dummies Questions & Answers 3 10-04-2001 10:54 AM



All times are GMT -4. The time now is 06:00 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2010. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0