From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu From: cLIeNUX user Message-ID: References: <20001223193414.7EA87199DD@mail.cse.psu.edu> Subject: Re: [9fans] scripting sam Date: Tue, 2 Jan 2001 17:35:42 +0000 Topicbox-Message-UUID: 40ad2818-eac9-11e9-9e20-41e7f4b1d025 anothy@cosym.net... >//plan 9 has been around for nearly 10 years. all this >//'why can't i have my favourite toy on it?' mail is a >//bit much. > >and i've been at least a casual user for almost half of >that. how is asking about sam "why can't i have my favorite >toy"? i was asking how to better use the tools Plan 9 >provides. yeah, you can write telnet with echo and cat; how >exactly is that relavant to the issue at hand again? i'm >well aware of the power of the system... which is exactly >why i was asking how to use it, and the tools it provides, >better, rather than sticking with sed (which can do what i >want, but i'd need to use the hold spaces, which are ugly). > >much thanks to everyone who responded helpfully. >-. h is for help. In cLIeNUX sam. Easy hack, BTW. ____________________________________________________________________________ cLIeNUX sam/tp text processing language cheatsheet cheatsheet markup... refNAME `default' "virtual" /delimited/ 0_or_more... syntax operators (in commands, not patterns or strings) delimiter any punctuation, paired or with EOL next character is literal \ text location operators (address elements) linefeed (unix newline) \n "empty line" at End Of File $ current text segment . MARKed text segment ' scanning DIRection - or `+' Line Number Character Number # match scan PATtern /regular expression, \n allowed/ OFFset LN or CN or PAT or `1' HALF address full ADDRess , just , is whole buffer text inputs INTERactive accept typed text up to . alone on line Whole Match Backreference & SUBmatch backreference \ nth match ()-delimited in PAT LITeral string /literal text and|or WMB... and|or SUB.../ INPUT LIT or INTER commands and thier PHRASE syntaxes, some multi-buffer phrases omitted a _append_ INPUT after address b make buffer the current buffer c _clobber_ address with INPUT d _delete_ addressed range of text e _edit_ file, make file current buffer f rename current buffer g PHRASE do PHRASE _if_ PAT matches in ADDR h You're soaking in it. i _insert_ INPUT before address k mark address for reference as ' m move, not copy n list buffers p _print_ to stdout. usual default command. q _quit_. Always works the second time. r _read_ file into buffer after ADDR s use xc instead t copy u undo. Unlimited, but one-way. v PHRASE do PHRASE if PAT _doesn't_ match in ADDR w _write_ out ADDR. default is whole buffer. x PHRASE for each match of PAT in ADDR do PHRASE y PHRASE do PHRASE on text between each PAT in ADDR ............................................................................ Rick Hohensee Forth, unix, nutmeg, tinsel