Re: Inserting Text In Specific Location Using Shell Script
- From: Bill Medland <billmedland@xxxxxxxxxxxxxxxx>
- Date: Fri, 26 May 2006 13:09:59 -0700
Never actually had to do it myself (I would use Perl) but this
seems to work
cat myfile | sed -e "/#comment 2/aFirst line\nSecond Line"
On May 26, 2006 12:51 pm, Cesar Covarrubias wrote:
Hello,
I am running a script on about 30 machines and need to insert
text after a specific comment. For example:
#comment 1
#comment 2
#comment 3
I want to add text after #comment 2, on a new line. I have
been trying to work with both sed and awk but no success. This
has to be done in bash or sh and cannot be done in any other
language. Any ideas? --
Very Respectfully,
Cesar Covarrubias
cesar@xxxxxxx
--
Bill Medland
mailto:billmedland@xxxxxxxxxxxxxxxx
http://webhome.idirect.com/~kbmed
--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list
- References:
- Inserting Text In Specific Location Using Shell Script
- From: Cesar Covarrubias
- Inserting Text In Specific Location Using Shell Script
- Prev by Date: Inserting Text In Specific Location Using Shell Script
- Next by Date: RE: Inserting Text In Specific Location Using Shell Script
- Previous by thread: Inserting Text In Specific Location Using Shell Script
- Next by thread: RE: Inserting Text In Specific Location Using Shell Script
- Index(es):