Date: Tue, 25 Sep 2007 11:28:56 -0700 From: Gary Kline <kline@tao.thought.org> To: Nikos Vassiliadis <nvass@teledomenet.gr> Cc: Gary Kline <kline@tao.thought.org>, freebsd-questions@freebsd.org Subject: Re: sed question... Message-ID: <20070925182855.GH50519@thought.org> In-Reply-To: <200709252038.50704.nvass@teledomenet.gr> References: <20070925013723.GA50027@thought.org> <200709250931.05367.nvass@teledomenet.gr> <20070925165844.GD50519@thought.org> <200709252038.50704.nvass@teledomenet.gr>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 25, 2007 at 08:38:50PM +0300, Nikos Vassiliadis wrote: > On Tuesday 25 September 2007 19:58, Gary Kline wrote: > > But trying to parse this from man sed is more than > > difficule. And I have yet to find "ba" in the man page. That is > > why I asked for some insights rather that to be told to "go read > > the man page"; to me, that's dismissing the issue rather than > > addressing it. > > Hm, my suggestion was wrong... sed is a bit cryptic to learn from the > manual page. The manual can be used as a reference, if you alread know > sed. > > So, ba is: > branch to the a label > for example: > my_label: > ... > bmy_label Thank you! This will help me de-code that sed one-liner that was evidently written by a sedexpert. The linux pages help further, but I've found some soild tutorials. > > My points are: > If you want to learn sed, you have to invest some time. > If you want to ask for an one-liner that does what you want, > that's fine too. > > sed isn't only s/foo/bar/. There is a dc(1) clone in sed, > which is at least an amazing accomplishment for sed. You > might want (or not) to learn more things about it. > > > Right. I always do a perl -pi.bak [...] mostly out of habit. > > With sed, redirection saved the new output, leaving the original > > in ``.'' FWIW, I was using the sed on my Ubuntu server. It is > > different from the BSD sed that I've used now/then since 1978. > > I think this version of sed is different too, since it's part > of BSD since 4.4BSD. It may be compatible with the older BSD > one. The in-place replacement is a non-standard extension which > both BSD and GNU sed share. > The last time I used sed seriously was in the early 80's; then there was only redirection :-) much obliged for your tips. I've got to write a shell/sed script to edit the rest of this stuff. Time to invest!! gary > Cheers > > Nikos > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" -- Gary Kline kline@thought.org www.thought.org Public Service Unix http://jottings.thought.org http://transfinite.thought.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070925182855.GH50519>