On Mon, Sep 01, 2008, William L. Maltby wrote: > >On Sun, 2008-08-31 at 19:45 +0200, Thomas Johansson wrote: >> Hi >> >> Perhaps omeone might answer this tricky problem. I can do this other >> ways, but i really want to understand how to solve it using ed. I have >> one solution using g/re/s/re//txt/ , but I want to understand how or if >> i can solve it using the ed (.)a command. > >OK. But keep in mind that many folks (and distros?) believe ed is >hopelessly outdated and some even advocate its removal from >distributions. Thankfully some other packages(s) depend on it. Instead of ``ed' one can use ``ex'' which should be in any distribution as its part of ``vi'' or ``vim''. I think the command set of ``ed'' is a subset of ``ex'' so scripts should work the same. I frequently use the gnu shtool program for this sort of thing unless the job is very simple, and I really want to edit the file in place. Bill -- INTERNET: bill@xxxxxxxxxxxxx Bill Campbell; Celestial Software LLC URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way Voice: (206) 236-1676 Mercer Island, WA 98040-0820 Fax: (206) 232-9186 The stamping of paper is an operation so much easier than the laying of taxes, that a government, in the practice of paper emissions, would rarely fail, in any such emergency [such as an election], to indulge itself too far in the employment of that resource... -- Alexander Hamilton _______________________________________________ CentOS mailing list CentOS@xxxxxxxxxx http://lists.centos.org/mailman/listinfo/centos