Re: [9fans] Non-parallel loop in Sam



Thank you for your advice.

Don't forget that you have a lot of text-oriented tools at
your disposal in any Unix or Plan 9 environment. To
reverse the order of lines within a file already opened by
sam, I would simply enter the following sam commands:
,| nl | sort -rn
,x/^ +[0-9]+ /d
(on Solaris; maybe a slight change would be needed on Plan 9).
This would be better packaged as a shell script, using sed
rather than sam for the final number-stripping operation.
You could then merely invoke that script for whatever "dot"
region is selected in sam:
| reverse # the script name
It is nice to build up a little collection of useful
editing scripts. Sometimes it is useful to enter nroff
source and pipe it through nroff for automatic formatting:
unformatted text
.pl 12p\"prevent spacing to end of page afterward
.ll 2i
.tl 'le'ctr'ri'
.ce
centered title
formatted text
unformatted text
Highlight (set dot to) all but the "unformatted text" and
enter the same command
| nroff -Tlp
(on Solaris; for Plan 9 -Tlp is probably different). The
-ms or other nroff macro package could be used, as desired.

I see. The key point is to use external utilities, rather than depend
only on Sam itself. And not only the scripts you provided here but
also some specific utilies, say tac, can be applied in my question.

Thanks.


--
HZ
.



Relevant Pages

  • Re: [9fans] Non-parallel loop in Sam
    ... In sam, you can specify sequential edits on separate lines, ... maybe a slight change would be needed on Plan 9). ... You could then merely invoke that script for whatever "dot" ... Sometimes it is useful to enter nroff ...
    (comp.os.plan9)
  • Re: [9fans] Non-parallel loop in Sam
    ... impliment non-parallel loop/condition commands in Sam? ... In sam, you can specify sequential edits on separate lines, ... You could then merely invoke that script for whatever "dot" ... Sometimes it is useful to enter nroff ...
    (comp.os.plan9)
  • RE: Help With Bulk User Creation Script
    ... "Sam" wrote: ... Have a look at Richard Mueller's site, he has a script that already does ... Dim sFname, sLName, sHomedrive, sLogscript, sDescription, sHomeDir ... Sub CreateaUser() ...
    (microsoft.public.windows.server.scripting)
  • Re: [9fans] Plan 9 wireless how-to...
    ... Seems like it is working everywhere - sam, ... It is really strange behavior... ... Actually seems like commands within ACME toolsbar do ... USB add-in cards usually have OHCI host controllers, which Plan 9 does not ...
    (comp.os.plan9)
  • Re: [9fans] Plan 9 wireless how-to...
    ... Seems like it is working everywhere - sam, ... USB add-in cards usually have OHCI host controllers, which Plan 9 does not ... The supported host controllers on Plan 9 are ...
    (comp.os.plan9)