Re: Script to edit a file
- From: Henry Townsend <henry.townsend@xxxxxxxx>
- Date: Tue, 07 Aug 2007 14:29:41 -0400
Pascal Bourguignon wrote:
Benjamin <benjamin.dizenhouse@xxxxxxxxx> writes:
I'm new to unix and need some help creating a script to edit a file.
Lets assume the file's location is /opt/server_config
I need to edit the line in this file "hostname=<<followed by the
hostname>>" to become "hostname="
Is this possible via a script?
Thanks for any and all help!
Yes.
I would advise you to learn emacs which is a powerful and fully
scriptable editor.
Otherwise, for a lot of simple edits, you can use sed, (Stream EDitor).
For example:
For operating on a file in place, better to use ed than sed (thus the names, EDitor vs Stream EDitor).
.
- Follow-Ups:
- Re: Script to edit a file
- From: Giorgos Keramidas
- Re: Script to edit a file
- References:
- Script to edit a file
- From: Benjamin
- Re: Script to edit a file
- From: Pascal Bourguignon
- Script to edit a file
- Prev by Date: Re: socket(AF_INET,SOCK_STREAM,0) function is returning with the errono 24
- Next by Date: Re: Script to edit a file
- Previous by thread: Re: Script to edit a file
- Next by thread: Re: Script to edit a file
- Index(es):
Relevant Pages
|