From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <002001c2e2e3$d0f0f0e0$2a8be793@gli.cas.cz> From: "peter a. cejchan" To: <9fans@cse.psu.edu> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_001D_01C2E2EC.32A79D40" Subject: [9fans] Re: \n\n\n to \n\n Date: Wed, 5 Mar 2003 07:52:40 +0100 Topicbox-Message-UUID: 795b8270-eacb-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. ------=_NextPart_000_001D_01C2E2EC.32A79D40 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable > however, sed doesn't like long lines=20 > you could do it in sam: s/\n\n\n/\n\n/g finally, i did it using acme's Edit. Thanks! I just wonder why Edit is a built-in... I would prefer piping to = (streamed) sam... wouldn't that be a cleaner solution? One of the things I love on = unix/plan 9 is their modularity, thus, why to have a standalone webbrowser when there is acme + hget + gif = (page), likewise with mail, and why to have a built-in Edit when there is acme + sed (ssam, awk, = perl....)? Or am I missing something? Thanks, ++pac ------=_NextPart_000_001D_01C2E2EC.32A79D40 Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable
> however, sed doesn't = like long=20 lines
> you could do it in sam: = s/\n\n\n/\n\n/g


finally, i=20 did it using acme's Edit. Thanks!
 
 
I just wonder why Edit is a built-in... I would = prefer=20 piping to (streamed) sam...
wouldn't that be a cleaner solution? One of the = things I=20 love on unix/plan 9 is their modularity, thus,
why to have a standalone webbrowser when there = is acme +=20 hget + gif (page),
likewise with mail,
and why to have a built-in Edit when there is = acme + sed=20 (ssam, awk, perl....)?
Or am I missing something?
 
Thanks,
++pac
 
------=_NextPart_000_001D_01C2E2EC.32A79D40-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <002501c2e329$97797940$2a8be793@gli.cas.cz> From: "peter a. cejchan" To: <9fans@cse.psu.edu> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0022_01C2E331.F91327C0" Subject: [9fans] Re: \n\n\n to \n\n Date: Wed, 5 Mar 2003 16:12:09 +0100 Topicbox-Message-UUID: 7a0af9b2-eacb-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. ------=_NextPart_000_0022_01C2E331.F91327C0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable > And of course you can always wrap sam in a script just to > pretend that you have ssam. could someone show me , how? sorry for ignorance, ++pac ------=_NextPart_000_0022_01C2E331.F91327C0 Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable
>  And of course you can always wrap sam = in a=20 script just to
>  pretend that you have ssam.
 
could someone show me , how?
 
sorry for ignorance,
++pac
 
------=_NextPart_000_0022_01C2E331.F91327C0-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <64f5b14c528bef319ba1386d8850a473@mightycheese.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] Re: \n\n\n to \n\n From: "rob pike, esq." In-Reply-To: <002001c2e2e3$d0f0f0e0$2a8be793@gli.cas.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Wed, 5 Mar 2003 09:26:26 -0800 Topicbox-Message-UUID: 7a14cc44-eacb-11e9-9e20-41e7f4b1d025 > I just wonder why Edit is a built-in... I would prefer piping to (streamed) sam... > wouldn't that be a cleaner solution? First, there isn't a streamed sam, and second, streaming only works for one file. Second, you *can* stream text through commands; I do it all the time. (|fmt, |sort, |tr A-Z a-z, etc. etc.) But to answer your question: I find the X command extremely powerful, and can't see any way to have a streaming implementation that will look at multiple files simultaneously. One day I realized I could easily implement Edit as a command in acme, but that after about fifteen years of desultory thought I still didn't see the right way to build a stream sam. The X command was the clincher, and I started hacking. -rob From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <9be2f49cc7d7111fcf58683cd36844ef@vitanuova.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] Re: \n\n\n to \n\n From: rog@vitanuova.com MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Wed, 5 Mar 2003 18:05:36 +0000 Topicbox-Message-UUID: 7a30d790-eacb-11e9-9e20-41e7f4b1d025 > > And of course you can always wrap sam in a script just to > > pretend that you have ssam. > > could someone show me , how? the following script does something of the sort; if you were prepared to go without error messages, you could dispense with the clunky sed script. unfortunately it produces output even if there's an error in the script. i don't know if there's anything that can be done about that... use like: echo hello | ssam ',x/l/c/x/' it's only had 'presotto' testing... #!/bin/rc { { for (i) echo $i echo w /fd/1 } | sam -d /fd/3 |[2] sed -e '/^\?changed files/d' -e '/^[^?]/d' -e 's/\?/ssam: /' >[1=2] } <[3=0] From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <371e22e5a847b7aedc0581e764162c63@plan9.escet.urjc.es> To: 9fans@cse.psu.edu Subject: Re: [9fans] Re: \n\n\n to \n\n From: Fco.J.Ballesteros In-Reply-To: <002501c2e329$97797940$2a8be793@gli.cas.cz> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-aeaseuchnqqnsehkqlpdaicvft" Date: Wed, 5 Mar 2003 20:20:58 +0100 Topicbox-Message-UUID: 7a977fea-eacb-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-aeaseuchnqqnsehkqlpdaicvft Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit This is naive and dirty but it's what I use: I pass different `command lines' to sam by using different arguments. It can be done better for sure but I didn't bother. hth #!/bin/rc t=/tmp/ssam.$pid fn exit () { rm -f $t } cat > $t { for (c in $*) echo $c echo q } | sam -d $t >[2] /dev/null rm -f $t --upas-aeaseuchnqqnsehkqlpdaicvft Content-Type: message/rfc822 Content-Disposition: inline Received: from mail.cse.psu.edu ([130.203.4.6]) by aquamar; Wed Mar 5 18:20:45 MET 2003 Received: from psuvax1.cse.psu.edu (psuvax1.cse.psu.edu [130.203.30.6]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id 237EB19AA9; Wed, 5 Mar 2003 12:19:22 -0500 (EST) Delivered-To: 9fans@cse.psu.edu Received: from XMAIL.asuch.cas.cz (clusterb.asuch.cas.cz [147.231.136.17]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id BF80019A91 for <9fans@cse.psu.edu>; Wed, 5 Mar 2003 10:12:09 -0500 (EST) Received: from picture ([147.231.139.42]) by XMAIL.asuch.cas.cz over TLS secured channel with Microsoft SMTPSVC(5.0.2195.5329); Wed, 5 Mar 2003 16:12:09 +0100 Message-ID: <002501c2e329$97797940$2a8be793@gli.cas.cz> From: "peter a. cejchan" To: <9fans@cse.psu.edu> Organization: paleobiology & paleoecology lab MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0022_01C2E331.F91327C0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-OriginalArrivalTime: 05 Mar 2003 15:12:09.0416 (UTC) FILETIME=[9777A480:01C2E329] Subject: [9fans] Re: \n\n\n to \n\n Sender: 9fans-admin@cse.psu.edu Errors-To: 9fans-admin@cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.0.11 Precedence: bulk Reply-To: 9fans@cse.psu.edu List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Archive: Date: Wed, 5 Mar 2003 16:12:09 +0100 This is a multi-part message in MIME format. ------=_NextPart_000_0022_01C2E331.F91327C0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable > And of course you can always wrap sam in a script just to > pretend that you have ssam. could someone show me , how? sorry for ignorance, ++pac ------=_NextPart_000_0022_01C2E331.F91327C0 Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable
>  And of course you can always wrap sam = in a=20 script just to
>  pretend that you have ssam.
 
could someone show me , how?
 
sorry for ignorance,
++pac
 
------=_NextPart_000_0022_01C2E331.F91327C0-- --upas-aeaseuchnqqnsehkqlpdaicvft-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <000801c2e3a9$36cf2b00$2a8be793@gli.cas.cz> From: "peter a. cejchan" To: <9fans@cse.psu.edu> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0005_01C2E3B1.9888BD90" Subject: [9fans] Re: \n\n\n to \n\n Date: Thu, 6 Mar 2003 07:25:42 +0100 Topicbox-Message-UUID: 7b02a806-eacb-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C2E3B1.9888BD90 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable >> I just wonder why Edit is a built-in... I would prefer piping to = (streamed) sam... >> wouldn't that be a cleaner solution? > First, there isn't a streamed sam, and second, streaming only works > for one file. Second, you *can* stream text through commands; I do = it > all the time. (|fmt, |sort, |tr A-Z a-z, etc. etc.) So do I. I was just curious why there is a built-in Edit instead of = having "a better sed" ... I thought of Acme as of an environment (say, glue), not a text teditor. Would love to have = Plan 9 like a "LEGO" (TM), and more: single=20 piece for every "task".... maybe stupid, but I would love sed with = capabilities of Edit... PS: I'm going to test the posted wrappers to Sam, and then, hopefully, = forget of Edit, and |sed ;-) ++pac ------=_NextPart_000_0005_01C2E3B1.9888BD90 Content-Type: text/html; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable
>> I just wonder why = Edit is a=20 built-in... I would prefer piping to (streamed) sam...
>> = wouldn't that=20 be a cleaner solution?


>  First, there isn't a = streamed=20 sam, and second, streaming only works
>  for one file.  = Second,=20 you *can* stream text through commands; I do it
>  all the=20 time.  (|fmt, |sort, |tr A-Z a-z, etc.  etc.)
So do I. I was just curious why there is a = built-in Edit=20 instead of having "a better sed" ... I thought of Acme
as of an environment (say, glue), not a text = teditor.=20 Would love to have Plan 9 like a "LEGO" (TM), and more: single =
piece for every "task".... maybe stupid, but I = would love=20 sed with capabilities of Edit...
 
PS: I'm going to test the posted wrappers to = Sam, and=20 then, hopefully, forget of Edit, and |sed   ;-)
++pac
 
------=_NextPart_000_0005_01C2E3B1.9888BD90-- From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu From: "Douglas A. Gwyn" Message-ID: <3E67E3AD.1010209@null.net> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit References: <000801c2e3a9$36cf2b00$2a8be793@gli.cas.cz> Subject: Re: [9fans] Re: \n\n\n to \n\n Date: Fri, 7 Mar 2003 11:14:05 +0000 Topicbox-Message-UUID: 7cb33558-eacb-11e9-9e20-41e7f4b1d025 peter a. cejchan wrote: > PS: I'm going to test the posted wrappers to Sam, and then, hopefully, > forget of Edit, and |sed ;-) The main advantage of sed is that it can process in a truly streaming fashion, whereas sam, ed, etc. all have to see the end of file on the input before any editing can be done to the file. From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@cse.psu.edu Subject: Re: [9fans] Re: \n\n\n to \n\n From: Fco.J.Ballesteros In-Reply-To: <3E67E3AD.1010209@null.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="upas-bgyfybxyanppvjnmnezsuipmkg" Date: Fri, 7 Mar 2003 13:34:33 +0100 Topicbox-Message-UUID: 7cb90ab4-eacb-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. --upas-bgyfybxyanppvjnmnezsuipmkg Content-Disposition: inline Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit I using all of Edit, sed, ssam. Depending on the kind of task I use one or another. So, let's not forget Edit :-) --upas-bgyfybxyanppvjnmnezsuipmkg Content-Type: message/rfc822 Content-Disposition: inline Received: from mail.cse.psu.edu ([130.203.4.6]) by aquamar; Fri Mar 7 12:22:26 MET 2003 Received: from psuvax1.cse.psu.edu (psuvax1.cse.psu.edu [130.203.30.6]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id E37BB19A6F; Fri, 7 Mar 2003 06:22:08 -0500 (EST) Delivered-To: 9fans@cse.psu.edu Received: from mercury.bath.ac.uk (mercury.bath.ac.uk [138.38.32.81]) by mail.cse.psu.edu (CSE Mail Server) with ESMTP id A9DD419A04 for <9fans@cse.psu.edu>; Fri, 7 Mar 2003 06:21:35 -0500 (EST) Received: from news by mercury.bath.ac.uk with local (Exim 3.12 #1) id 18rFoF-0003zs-00 for 9fans@cse.psu.edu; Fri, 07 Mar 2003 11:14:39 +0000 Received: from GATEWAY by bath.ac.uk with netnews for 9fans@cse.psu.edu (9fans@cse.psu.edu) To: 9fans@cse.psu.edu From: "Douglas A. Gwyn" Message-ID: <3E67E3AD.1010209@null.net> Organization: University of Bath Computing Services, UK Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit References: <000801c2e3a9$36cf2b00$2a8be793@gli.cas.cz> Subject: Re: [9fans] Re: \n\n\n to \n\n Sender: 9fans-admin@cse.psu.edu Errors-To: 9fans-admin@cse.psu.edu X-BeenThere: 9fans@cse.psu.edu X-Mailman-Version: 2.0.11 Precedence: bulk Reply-To: 9fans@cse.psu.edu List-Id: Fans of the OS Plan 9 from Bell Labs <9fans.cse.psu.edu> List-Archive: Date: Fri, 7 Mar 2003 11:14:05 GMT peter a. cejchan wrote: > PS: I'm going to test the posted wrappers to Sam, and then, hopefully, > forget of Edit, and |sed ;-) The main advantage of sed is that it can process in a truly streaming fashion, whereas sam, ed, etc. all have to see the end of file on the input before any editing can be done to the file. --upas-bgyfybxyanppvjnmnezsuipmkg--