Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: using ed  (Read 3514 times)

0 Members and 1 Guest are viewing this topic.

justsmile

  • Guest
using ed
« on: June 02, 2009, 02:16:00 PM »
If I use ed for a file and then do the following:
g/the/s/the/one/g
g/the$/s/the$/one/
g/^the/s/^the/one/
do I need trailing g for the second and third statments ? and if not why not?

gh0std0g74



    Apprentice

    Thanked: 37
    Re: using ed
    « Reply #1 on: June 02, 2009, 07:32:51 PM »
    i suggest awk
    Code: [Select]
    awk '{gsub("the","one")}' file

    this says to globally replace word "the" to "one"