![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Removing a file name (-T-G1) | bobo | UNIX for Dummies Questions & Answers | 3 | 03-05-2008 11:26 AM |
| removing a line from a file and then placing into another file | iago | UNIX for Dummies Questions & Answers | 1 | 09-09-2007 01:46 AM |
| Use "read" with a text file with comments | mbarberis | Shell Programming and Scripting | 3 | 03-30-2005 02:24 AM |
| removing file | vbaskar | UNIX for Advanced & Expert Users | 5 | 02-12-2002 04:43 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
removing comments from file
I'm doing manual way to add and remove "#" on etc/services.
Is there anyway I can modify the file using awk or sed or any other program. I use vi to modify /etc/services for enabling telnet , the problem is I don't know how to do it automatically in script. production state: #telnet maintenance state: telnet production state: #telnet Thanks. |
|
|||||
|
Nope, there usually is no impact when overwriting the file. But you have to write it 1st into some temporary file and then cp or mv it over the original. Doing so, it is usually good to have copy of the former original before you modified.
May I ask what this is good for or is the services and telnet just an example? |
![]() |
| Bookmarks |
| Tags |
| solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|