Re: [9fans] keyboard map for a czech keyboard

2009-03-17 Thread Rudolf Sykora
ok. I tried what I said and it really works... R 2009/3/11 Rudolf Sykora : > Hello, > > I'd like to teach my plan9 read my Czech keyboard. > But I don't know exactly what I have to change. > I wonder if it's enough to modify e.g. /sys/lib/kbmap/us, save it to >

[9fans] plan9 for calculations

2009-03-27 Thread Rudolf Sykora
Hello everybody, I noticed there are some thoughts about using plan9 on supercomputers. For me supercomputers are usually used to do some heavy calculations. And this leads me to a question. What software is then used for programming these calculations? (I mean e.g. linear algebra, i.e. matrix, ca

Re: [9fans] Using the Acme Editor

2009-04-05 Thread Rudolf Sykora
Hello after some time I crossed this matter again... /old/c/new/ doesn't scroll to the dot where the change happens in neither sam nor acme. My feeling is that it should. (Should there be any reason for different behaviour compared to the situation when the command is split as /old/ followed by c

[9fans] double click selects a word

2009-04-06 Thread Rudolf Sykora
Hello all is there any good reason for a double click (in rio, sam, acme, ...) to select a word (probably) defined by sth. like /[a-zA-Z0-9_]+/ and not sth. white-space delimited instead? Double clicking e.g. on 'text.txt' only selects 'text' or 'txt', while one usually wants the whole. The same

Re: [9fans] double click selects a word

2009-04-06 Thread Rudolf Sykora
ok then. :) r > one man's `usually' is another man's `never'. > it's one reason i use 9term on linux. > we probably both say ``what were they thinking??'' about > contrary effects.

[9fans] window's content clearing

2009-04-08 Thread Rudolf Sykora
Hello, Imagine I have a rio window with a long history, i.e. lots of text have been entered and the scroll bar is just a tiny box. And I'd like to clear everything, so that only the last prompt remains. I know I can clear some portions with a mouse. But that is often tedious. Is there any nice way

Re: [9fans] double click selects a word

2009-04-08 Thread Rudolf Sykora
2009/4/7 Francisco J Ballesteros : > In omero double click does the same, and triple is more hungry. You could > try that modifying your local system That's a good idea. I'll try. thanks r

Re: [9fans] window's content clearing

2009-04-08 Thread Rudolf Sykora
2009/4/8 hugo rivera : > In acme you can do something like > Edit ,$-1d > but I don't know how to deal with a terminal outside acme. Well, this is true. In an editor you have the wings... [Btw., also reading a man page is somewhat easier in an editor for me since I can search in the text then, whi

[9fans] noweb and literal programming

2009-04-10 Thread Rudolf Sykora
Hello, I've been thinking about 'well documented programs' and come across the 'noweb' program. Do you have any experience with literal programming and, particularly, noweb? (I noticed at least rsc seems to have played with it back in the year 2000. He programmed some scripts to use the system in

Re: [9fans] noweb and literal programming

2009-04-11 Thread Rudolf Sykora
> Just curious... what's the relation to Cweb and Ctangle (the ones Knuth uses)? > > From what I've heard of those (even from Knuth himself) is that > they're too ugly to use very much, and fits well with Knuth's style, > which is mostly the "giant blob of code" style. As far as I can tell, cweb (

[9fans] web server

2009-04-16 Thread Rudolf Sykora
Hello, I've been wondering (and not reading much)... If I'd like to use plan9 as a www server, is there anything ready? How difficult would it be to use rails or merb in plan9? Is it feasible? thanks ruda

Re: [9fans] web server

2009-04-16 Thread Rudolf Sykora
> >> How difficult would it be to use rails or merb in plan9? Is it feasible? > > Very difficult. No, not feasible. You would have to port Ruby. And > then possibly rails, too. Plan 9 isn't UNIX, or UNIX-like, or POSIX > (or POSIX-like). APE helps with some stuff, but not all the way. I thought I'

Re: [9fans] web server

2009-04-17 Thread Rudolf Sykora
2009/4/17 maht : > How difficult would it be to use rails or merb in plan9? Is it feasible? > > Not Rails or merb or anything non Plan 9 but a few of us are building an rc > shell based system that works anywhere CGI and Plan 9 / plan9port is > available. > > http://werc.cat-v.org/ Yes, I've

Re: [9fans] web server

2009-04-17 Thread Rudolf Sykora
> Writing the core of a blog engine in three lines of rc is hard to > beat, plus you get the benefit of being able to manipulate and manage > all your data using the tools any self respecting Unix user loves. > > uriel well, I haven't thought about it deeply yet, but what I guess could be a proble

Re: [9fans] web server

2009-04-17 Thread Rudolf Sykora
2009/4/17 maht : > >> well, I haven't thought about it deeply yet, but what I guess could be >> a problem with your approach is that many features would have to be >> somehow implemented first so that it all be useable. I mean e.g. ajax >> style of page content refresh, session management, perhaps

[9fans] missing ed's line numbering in sam -d

2009-04-23 Thread Rudolf Sykora
Hello, when using 'sam -d' to remotely edit files I really miss the option to print line numbers along with lines, like ed's e.g. '1,10n'. Is there anything like that? Why not? Thanks Ruda

[9fans] squeak (smalltalk) + seaside in plan9

2009-04-25 Thread Rudolf Sykora
Hello everyone, just a question: Playing with squeak smalltalk implementation I've wondered if there could be squeak (with all its ready environment) ever running under plan9. Has anybody thought about that? ... I've found seaside (web devel. framework) rather interesting. It's more like program

[9fans] ssh v2, using a remote linux server

2009-05-03 Thread Rudolf Sykora
Hello everyone, 2 questions... 1) The linux servers around me reject ssh v1 protocol by default, only seem to accept v2. The version commonly available in plan9 seems to be v1. As long as I connect to my own machine, where I allowed v1 connection, no problem. But is there any working v2 client? I

[9fans] problems with redirection in rc

2009-05-05 Thread Rudolf Sykora
Hello everyone! To get some useful information from a file I write: ; for (i in *_r) @{cd $i; echo -n $i^' '; grep total otdit | grep -v na} to get lines from the 'otdit' files in *_r subdirectories with the word 'total' on them, but no 'na' on them. This works to my liking and produces sth. li

Re: [9fans] problems with redirection in rc

2009-05-05 Thread Rudolf Sykora
2009/5/5 Anthony Sorace > what's surprising is that this behavior changed based on *only* > changing the > to a >>. you're sure you didn't change placement as > well? i'd have expected your output file in the > case to match the > results for the last _r label from the output file in the >> case.

Re: [9fans] problems with redirection in rc

2009-05-05 Thread Rudolf Sykora
2009/5/5 roger peppe : > {for (i in *_r) @{cd $i; echo -n $i^'  '; grep total otdit | grep -v na}} > > res > with this I get the same as with for (i in *_r) @{cd $i; echo -n $i^' '; grep total otdit | grep -v na} >> res which is now reasonable, having read R. Cox' post. Thanks ruda

Re: [9fans] problems with redirection in rc

2009-05-05 Thread Rudolf Sykora
2009/5/5 Anthony Sorace : > //  ];/home/sykora/CALC/doing/tests/10_r/-xeon4 10_r ... > > i think these are escape sequences generated by a defined 'cd' > function containing awd. do "fn cd" before you run this to undefine > the function and this should go away. true. thanks ruda

Re: [9fans] problems with redirection in rc

2009-05-05 Thread Rudolf Sykora
> You've got the cd implementation from label(1) loaded. > In interactive mode, it echos escape codes that are > supposed to update the label in your terminal window. > Instead it wrote them to the redirected file. > > I changed label to write to /dev/tty explicitly, which should > avoid this probl

[9fans] rc - no continue, next in a loop

2009-05-11 Thread Rudolf Sykora
Hello everyone, I just realized there are no 'continue' and 'next' commands in rc. Is there any way to e.g. quit the loop when one wants? Thanks Ruda

[9fans] sources down?

2009-05-22 Thread Rudolf Sykora
Hello when I try '9fs sources' I get a timeout establishing connection... (all day today) I guess it's not my problem, or is it? Thanks Ruda (why does this happen SO OFTEN?)

Re: [9fans] sources down?

2009-05-22 Thread Rudolf Sykora
>> (why does this happen SO OFTEN?) > > warning: complaining about something you get for free is > counter-productive. Unless, of course, you are also offering to help > in some way. > > ron well, maybe. Maybe not. In order I be of any help I need to know why the hell this happens, first. I know

Re: [9fans] sources down?

2009-05-22 Thread Rudolf Sykora
> While not having direct knowledge of what caused the current outage, I > can say that such outages are rarely caused by Plan 9 or the hardware > on which its running. Ok. So what caused the other outrages in the recent past? (I may give at least one other date, on which I even asked the same que

Re: [9fans] sources down?

2009-05-25 Thread Rudolf Sykora
> nobody's saying anything, so i will: a kfs system will be left in an > "allowed" state if all the mirrors fail. well, knowing little, having come late, perhaps, I do not understand... Thanks Ruda

[9fans] python reloaded

2009-05-25 Thread Rudolf Sykora
Hello, I wanted to install python. From /n/sources/contrib/bichued/python I downloaded python-2.5.1-ape.tgz python-2.5.1-sys.tgz. I untared the former in my home directory. I untared the latter in / (I got /sys/python created...) --- this I read in README.Plan9 file in python-2.5.1-ape.tgz. Als

[9fans] persuade contrib/install to work

2009-05-26 Thread Rudolf Sykora
Hello, since I somehow still can't connect to the 'central sources' and want to make some progress, I tried to follow some of your recent advices. Instead of '9fs sources' I do 9fs sources.lsub.org cd /n bind sources.lsub.org/sources sources so now it seems I have the state similar to after just

Re: [9fans] new usb implementation

2009-05-26 Thread Rudolf Sykora
Thanks a lot! Ruda 2009/5/26 Devon H. O'Dell : > 2009/5/26  : >> I've just pushed out to sources a new USB implementation, courtesy of >> nemo, who debugged and repaired our old UHCI and OHCI drivers, wrote a >> new EHCI driver for USB 2, converted the user-mode drivers in /bin/usb >> and tested i

Re: [9fans] persuade contrib/install to work

2009-05-27 Thread Rudolf Sykora
OK. So I changed the line from /dist/replica/contrib:7: fn servermount { 9fs sources } to /dist/replica/contrib:7: fn servermount { test -d /n/sources/plan9 || 9fs sources } and it seems to work as wanted... thanks to all Ruda 2009/5/27 Federico G. Benavento : >> I think it would be better for

[9fans] limiting 'history' in a rio window

2009-05-28 Thread Rudolf Sykora
Hello, when a rio window with 'rc' running inside is used for entering commands it happens, after some time, that the amount of text is excessively high. If the text in the window could be edited (I mean not manually), then from time to time I could run some program that would leave only the last

[9fans] acme --- undo/redo in a win window

2009-05-28 Thread Rudolf Sykora
Hello, it is somehow unclear to me, what happens in a 'win' window when I 2-click 'Undo' or 'Redo' (I write it somewhere manually). Are some commands processed again? (I happened to delete some text from the window and thus had the idea to write 'Undo' and 2-click on it; sth. happened, but I am pu

Re: [9fans] acme --- undo/redo in a win window

2009-05-29 Thread Rudolf Sykora
Ok. It works so. Thanks Ruda > If as a result of those operations, new text appears > after the cursor output point, that text is sent to the > shell running in the window (or whatever is reading > from the console). > > Russ

[9fans] acme: dirty state after 1-2, 1-3 click in a tag line

2009-05-29 Thread Rudolf Sykora
Hello, I've noticed two strange things about acme: 1) when I snarf the name (or a part of it) of a file with a mouse (in the tag line) using 1-2, 1-3 mouse chord, the file is marked dirty. (I think it should not.) 2) i) when I open a win window, 'win' appears in the topmost tag line (if you open 2

Re: [9fans] acme: dirty state after 1-2, 1-3 click in a tag line

2009-05-30 Thread Rudolf Sykora
> Probably you have already noticed it, but if the dirty mark annoys you > can always select with 1 and use Snarf. > - yiyus || JGL . yes, I have, thanks anyway :) r

[9fans] simple question: multiple rename

2009-06-05 Thread Rudolf Sykora
Hello, I realized I cannot come up with a simple solution for the following. I want to rename all the files whose names end with _g_b to just _g, e.g. hello_g_b should be renamed to hello_g. I simply don't know an easy way. [the opposite way is simple: for(i in *_g) mv $i $i^_b ] I only think abou

Re: [9fans] simple question: multiple rename

2009-06-05 Thread Rudolf Sykora
> sed is your friend: > > s=`{ echo $i | sed -e 's/_g_b/_g/' } > > > Martin Oh yes, that's it. Thanks Ruda

Re: [9fans] simple question: multiple rename

2009-06-08 Thread Rudolf Sykora
Hello, Still wonder, what's the right way to make the following work: This is ok: sam -d <[2] /dev/null 1s/(.+)_g/\1 p EOF but now I want it all be inside `{}, like s = `{sam -d <[2] /dev/null 1s/(.+)_g/\1 p EOF } which doesn't work. I tri

Re: [9fans] simple question: multiple rename

2009-06-08 Thread Rudolf Sykora
> should be written as: > s = `{sam -d <[2] /dev/null} >... >EOF > > Hope that helps, >Martin OK, now I see. The } was at the wrong place... Thanks Martin thanks Russ, too. Ruda

[9fans] acme: send dot to the stdin of a more complicated command

2009-06-08 Thread Rudolf Sykora
Hello everyone, when I want to process a dot's contents in acme I can use the '>' syntax, e.g. have > awk '{print}' in a window, select it, and then 2-1 click on Edit in the window with my dot. That works. But what shall I do when the awk script is more complicated, in the simplest case like >

Re: [9fans] acme: send dot to the stdin of a more complicated command

2009-06-08 Thread Rudolf Sykora
> Put the awk code into a file and execute '> awk -f foo' in acme. well, I hoped this would be the last way... It makes me create files I don't actually need. Is it the newlines that causes troubles? Thanks Ruda

Re: [9fans] acme: send dot to the stdin of a more complicated command

2009-06-08 Thread Rudolf Sykora
> remember, this is plan9 and everything is a file. chances are your > "script" is already available in some filesystem and you don't need to > write it out:: create a new window inside acme, type your awk script > and then issue ">awk -f /mnt/wsys/X/body" where X is the ID of your > window. well,

Re: [9fans] acme: send dot to the stdin of a more complicated command

2009-06-08 Thread Rudolf Sykora
> and you want somebody do look through the code and figure it out for you? not really. I wanted to know whether 1) somebody thought about it (knowing the system has been around for some time I'd expect somebody must have had the same problem) 2) there is any good reason why it behaves so. Ruda

Re: [9fans] acme: send dot to the stdin of a more complicated command

2009-06-09 Thread Rudolf Sykora
> See http://swtch.com/~rsc/acme-Run.png for an illustration. > > Russ Thank you much! This is what I need and now I see how it can be achieved... :) Ruda

[9fans] acme: 2-1chord on Edit in a 'win window' tag doesn't work

2009-06-10 Thread Rudolf Sykora
Hello everyone, might be I am doing something wrong, but this seems to me like a bug... In some acme window I have a command, e.g simply s/f/g/, I select it with a mouse and 2-1 chord it on the Edit command in a tag line of a window in which there is win running and also some text (for us e.g. ab

Re: [9fans] acme: 2-1chord on Edit in a 'win window' tag doesn't work

2009-06-11 Thread Rudolf Sykora
> This is a design bug in acme. > Russ Ok, I understand. Thanks for the explanation! Ruda

[9fans] synchronization of time, setting time

2009-06-26 Thread Rudolf Sykora
Hello everyone, 1) If I want to set the hardware (on-board) clock by hand, how can I? 2) If I want to synchronize the hardware time with a ntp server (once / periodically), how can I? 3) If I run the 'timesync -n [ntp server]' command, how is the frequency of synchronization determined? If I run i

Re: [9fans] Sam commands in acme

2009-06-26 Thread Rudolf Sykora
2009/6/26 hugo rivera : > I tested the command you suggested (,x/\/\*/.,/\*\//) and it works as > I wanted, thanks. But there's something I still don't understand and > is the meaning of that comma in there. As far as I know, the comma is > a  mark that delimits the addresses that acme understands,

Re: [9fans] Auto Indenting in Acme

2009-07-03 Thread Rudolf Sykora
I think, if you write 'Indent on' somewhere in a window (e.g. the tag line) and execute it, indentation will be on for the given window; if you use 'Indent On' instead, it sould be set for all windows. Further, I guess off/Off should work the opposite way. The man page has it. Ruda 2009/7/3 Aaron

Re: [9fans] Auto Indenting in Acme

2009-07-03 Thread Rudolf Sykora
see also 'acme -a' > auto-indenting in plan9port's Acme editor?

[9fans] troff and ps related

2009-07-08 Thread Rudolf Sykora
Hello everyone, can anybody tell me why whatever .ps about troff/eqn I print has misplaced lines? E.g. quite generally, lines that make up tables either don't touch, or stick out somewhere... Also, should .BX something make a nice box around 'something' or not? Anywhere I look I see the top line

Re: [9fans] troff and ps related

2009-07-08 Thread Rudolf Sykora
2009/7/8 Russ Cox : > On Wed, Jul 8, 2009 at 4:49 AM, Rudolf Sykora wrote: >> can anybody tell me why whatever .ps about troff/eqn I print has >> misplaced lines? >> E.g. quite generally, lines that make up tables either don't touch, or >> stick out somewhere...

Re: [9fans] troff and ps related

2009-07-09 Thread Rudolf Sykora
2009/7/8 Russ Cox : > I assume you have a non-Plan 9 machine to play with. > It's worth trying Heirloom troff there to see if the boxes > are done better.  They probably are. as far as I see, they are not better. > I need to fall back to the Plan 9 troff, because the low-level > details seem to d

[9fans] troff: references

2009-07-23 Thread Rudolf Sykora
Hello, is there anything ready for troff/eqn that could help me with 1) automatic equation numbering with possible setting a label to an equation by means of which one could forward/backward reference the equation? 2) setting a label somewhere in the text, so one can reference it and obtain e.g. a

[9fans] p9p acme freezes when ctrl-f inside its mounted directory

2009-08-04 Thread Rudolf Sykora
Hello, I noticed that when running acme in plan9port and having its directories mounted say on /mnt/acme, then if I try from within a win window in the acme to auto-complete a directory name---I am in /mnt, I type 'a' and hit the 'insert' key or ctrl-f, or I am anywhere inside the acme filesystem-

Re: [9fans] p9p acme freezes when ctrl-f inside its mounted directory

2009-08-05 Thread Rudolf Sykora
2009/8/5 Russ Cox : > On Tue, Aug 4, 2009 at 10:33 AM, Rudolf Sykora wrote: >> I noticed that when running acme in plan9port and having its >> directories mounted say on /mnt/acme, then if I try from within a win >> window in the acme to auto-complete a directory name---I am

[9fans] ssh port specification

2009-08-09 Thread Rudolf Sykora
Hello everyone, I want to connect to a ssh server (v1) with the plan 9 ssh command. However, the server runs on a non-standard port (not 22). I can't figure out, how to specify the port number for the ssh command. Thanks... Ruda

Re: [9fans] ssh port specification

2009-08-09 Thread Rudolf Sykora
Thanks a lot... It works. ... I always forget that that leading tcp! is really necessary :) (even though I know why, on second thought) Ruda 2009/8/9 Lyndon Nerenberg : >> Hello everyone, >> I want to connect to a ssh server (v1) with the plan 9 ssh command. >> However, the server runs on a non-st

Re: [9fans] Using Guide Files

2009-08-10 Thread Rudolf Sykora
Also check the Run script we discussed earlier in this forum. Could be of help... Ruda 2009/8/10 Aaron W. Hsu : > Hello, > > When using guide files, let's say I have some Edit command or the like that > I run often on certain types of files. So I have the guide file open, and I > can copy the comm

Re: [9fans] Using Guide Files

2009-08-10 Thread Rudolf Sykora
A few words pertaining one of your points. 2009/8/10 Jason Catena : > For example, I often run "|fmt -w 72" to justify a paragraph in a text > file.  With wily, I can highlight text in any window, and justify the > text from one copy of the command stored in any guide file.  With > acme, I can't

Re: [9fans] Using Guide Files

2009-08-10 Thread Rudolf Sykora
2009/8/10 Jason Catena : > And so it does.  I assumed I could only use Edit in conjunction with > sam commands, but apparently Edit (or at least its author) is smarter > than that. Well, I'd say, that |... thing still _is_ a sam command..., only delivered to the Edit command via the chord now. (Al

[9fans] undelete a file

2009-08-13 Thread Rudolf Sykora
Hello everyone, I have, by mistake, deleted a file. I use fossil. I don't know much about how fossil works... Can I do something to get it back? I tried yesterday, but it says /n/dump/2009 doesn't exist. I looked in /n/dump and there is nothing. I tried '9fs dump' but even after that /n/dump/ is

[9fans] ugly eqn/troff result

2009-08-13 Thread Rudolf Sykora
Hello everyone Why do I get an ugly result when trying to typeset (in file 'a') .EQ a + left ( A + B right ) .EN with eqn a | troff | dpost -f > a.ps? I am getting an equation in which the 'A+B' is significantly shifted downwards inside the (), so that the two pluses just don't line up... Than

Re: [9fans] undelete a file

2009-08-13 Thread Rudolf Sykora
... Do I need venti to be able to use the dump feature? Thanks Ruda

Re: [9fans] undelete a file

2009-08-13 Thread Rudolf Sykora
2009/8/13 Anthony Sorace : > you need venti for dumps, but not snapshots. do "9fs snap" and then > see if there's anything in /n/snap. these are ephemeral, not archival. > > i don't believe fossil ships with these turned on by default, so > you're likely SOL, sorry. Well, after 9fs snap /n/snap is

[9fans] acme column Paste, Cut, Snarf commands

2009-08-26 Thread Rudolf Sykora
Hello, in a newbie-guide.pdf www.quanstro.net/newbie-guide.pdf I read: Column Menu: Snarf --- Copy the selected text into the snarf buffer (from anywhere in the column). For me it doesn't work like that. For me _all_ column menu Snarf (Past, Cut) commands are equivalent irrespectively of the

Re: [9fans] ugly eqn/troff result

2009-08-26 Thread Rudolf Sykora
One more trial... Really nobody uses 'eqn' these days?... Thanks Ruda 2009/8/13 Rudolf Sykora : > Hello everyone > > Why do I get an ugly result when trying to typeset (in file 'a') > > .EQ > a + left ( A + B right ) > .EN > > with > eqn a | tro

Re: [9fans] ugly eqn/troff result

2009-08-27 Thread Rudolf Sykora
> i do see that the +s don't line up, but only by 1 pixel. > why do you think they should?  i would think that the > centerline of the left ( right ) business should line up > with the centerline of a +.  but that's an uneducated > guess.  can you point to a reference that says eqn > behaves as you

[9fans] problems when hwaccel off or in inferno

2009-09-06 Thread Rudolf Sykora
Hello everyone, I'd like to ask whether anyone encountered problems when one turns off the hardware acceleration with cat hwaccel off > /dev/vgactl When I do it, my mouse leaves some garbage at some points, or, e.g. I can't nicely select text with the mouse---there are some pieces missing. I fou

Re: [9fans] nice quote

2009-09-06 Thread Rudolf Sykora
>> Considering that Plan 9 has only two inherent languages, >> and its users often push for work to be done in only those, >> what is the Plan 9 perspective of languages and tools in >> relation to each other? I guess rc & C are meant. True, I feel to be pushed to these. On the other hand I really

Re: [9fans] problems when hwaccel off or in inferno

2009-09-06 Thread Rudolf Sykora
2009/9/7 SHRIZZA : >> I'd like to ask whether anyone encountered problems when one turns off >> the hardware acceleration with >> cat hwaccel off > /dev/vgactl > > Of course, you mean "echo -n hwaccel off > /dev/vgactl", right? > yes, 'echo', not 'cat', actually echo hwaccel off > /dev/vgactl

Re: [9fans] problems when hwaccel off or in inferno

2009-09-07 Thread Rudolf Sykora
So is it so that anybody using vesa should see it in plan9 when hwaccel is off or when inferno runs on plan9 regardless the state of hwaccel? (At school I use i81x and plan9 itself is ok with both on/off.) Thanks Ruda 2009/9/7 Charles Forsyth : > there's a bug in the control of the software curs

[9fans] awk help; not plan9 matter

2009-09-17 Thread Rudolf Sykora
Hello, simple task. I want to change the 2nd field on each line of a file, but preserve the spacing of the lines. If I do awk '{$2="hell"; print}' file the field gets changed, but all the spacing of the lines is gone; i.e. any space is now just ' ' like this: 1 3 4 8 changes to 1

Re: [9fans] awk help; not plan9 matter

2009-09-17 Thread Rudolf Sykora
2009/9/17 matt : > sed 's/^([^ ]+ +)([^ ]+)/\1HELL/' Well, actually, my problem is a part of a more complicated script; I don't know in advance neither the column nor what to put there. I currently have this awk ' /TH/ {$'$pos'='$new'} {print} ' inpch where 'TH' plays a role of a g

Re: [9fans] awk help; not plan9 matter

2009-09-17 Thread Rudolf Sykora
2009/9/17 matt : > awk '{a=$2; sub(a, "hell"); print}' file The trouble with this is that the same string can appear more than once (before, after the field, ...), so the simple substitution isn't enough. Ruda

Re: [9fans] awk help; not plan9 matter

2009-09-17 Thread Rudolf Sykora
Ok. Thanks again. I think I've found what I need. (on lines of 'inpch' that contain 'TH' I change the field at position $pos to be $new, preserving spacing made of 'space's and/or tabs). If anyone comes up with sth. simpler... Ruda (The script is for 'rc', btw., so that the concatanation on the 3

[9fans] <> operator

2009-09-17 Thread Rudolf Sykora
Hello, is the <> operator a feature only of native plan 9? It doesn't seem to work for me in p9p... Is the right solution then, instead of program <> file write program < file > file_tmp mv file_tmp file ? Thanks Ruda

Re: [9fans] awk help; not plan9 matter

2009-09-17 Thread Rudolf Sykora
2009/9/17 yy : > if you want to preserve white-space, you better forget about fields > and work with indexes on the string, match is your friend: > > % echo '1      3 4           8' | awk '{match($0, /[ \t]*[^ \t]+[ > \t]+/);a=RLENGTH+1;match(substr($0, a), /[ \t]/);print > substr($0,0,a-1) "hell"

Re: [9fans] awk help; not plan9 matter

2009-09-17 Thread Rudolf Sykora
2009/9/17 erik quanstrom : > i don't know why this can't be done with sed.  if the > task is to just change the second field without messing > with whitespace, why doesn't this work As I said in my second post, neither the field (the problem with sed) nor the string to be used as a replacement (no

Re: [9fans] awk help; not plan9 matter

2009-09-17 Thread Rudolf Sykora
2009/9/17 Noah Evans : > Since you're doing character processing rather than record processing, > isn't C your best tool for the job here? > > This is what I whipped out YMMV: > > #include > #include > #include > > char *str; > int ntok; > > #define WHITESPACE(c)           ((c) == ' ' || (c) ==

Re: [9fans] awk help; not plan9 matter

2009-09-17 Thread Rudolf Sykora
2009/9/17 erik quanstrom : > fn buildre { >        re = 's:^' >        for(i in `{seq 1 $1}) >                re = $re ^ '([^         ][      ]*)' >        re = $re ^ '([^         ]):\' ^ $1 ^ $2 ^ : > } > > - erik > Yes, I now see yours and Roger Peppe's idea to build a regexps and then use it. T

Re: [9fans] awk help; not plan9 matter

2009-09-17 Thread Rudolf Sykora
2009/9/17 roger peppe : > just change the regexp as required. Ok. I decided (although just for game now) to play a little with the idea of building the regexp. Starting from Eric's post I slowly progressed to sth. quite similar to your post :) : fn buildre { re = 's:^([ ]*)(' f

Re: [9fans] awk help; not plan9 matter

2009-09-17 Thread Rudolf Sykora
2009/9/17 erik quanstrom : > i don't think you need an extra () for the leading > white space.  just tack it on in with the leading expression. see below > the hoc is unnecessary.  just start with 2. true :) > fn buildre { >        re = 's:^([     ]*' >        for(i in `{seq 2 $1}) >            

Re: [9fans] awk help; not plan9 matter

2009-09-17 Thread Rudolf Sykora
forget about my previous post regarding the leading space, I am tired, it was wrong... Anyway the question about () is still hot... R 2009/9/17 Rudolf Sykora : > 2009/9/17 erik quanstrom : >> i don't think you need an extra () for the leading >> white space.  just tack it on

[9fans] lout contra troff/TeX

2009-10-17 Thread Rudolf Sykora
Hello, is there anyone who could say a few words about their experience with the lout formatting system and how well it compares to the troff/TeX suite. Also, does anybody use it in plan9? Thanks, Ruda

Re: [9fans] fmt(1) standard behaviour

2009-10-18 Thread Rudolf Sykora
I may not fully understand the problem, but wouldn't it be just fine if fmt output anything it can already output? I.e., filled lines are output, on encountering '\n' the (generally unfilled) line is output... (Or what is the reason that fmt waits for EOF?) R

[9fans] bison problem, not plan9 related

2009-10-21 Thread Rudolf Sykora
Hello, sorry for an off-topic thing. But I guess somebody here could help me... I have a problem with bison grammer Having %token ATOM %left '+' %left REP and a grammar: block:ATOM | REP block | block '+' block ; is ok. Having another grammer: block:ATOM |

Re: [9fans] bison problem, not plan9 related

2009-10-21 Thread Rudolf Sykora
... anywhere where I wrote 'grammer' I meant 'grammar' ...

Re: [9fans] bison problem, not plan9 related

2009-10-21 Thread Rudolf Sykora
2009/10/21 Russ Cox : > To know how to decide, yacc needs a precedence > for the thing being shifted and the rule.  You've > given precedences for each rule (REP block has > REP's precedence, and block block has +'s thanks > to the override) but not to ATOM. > > Concretely, when yacc sees REP block

Re: [9fans] bison problem, not plan9 related

2009-10-21 Thread Rudolf Sykora
2009/10/21 Skip Tavakkolian <9...@9netics.com>: > i think this is what you want. untested: > > pair: REP ATOM >        | REP '[' block ']' > > block: pair >        | block pair Thanks. This would require there always be a REP before [ block ], which I don't want (cf. ordinary expression (1+2) ).

Re: [9fans] bison problem, not plan9 related

2009-10-21 Thread Rudolf Sykora
> So the %nonassoc says to the parser that > (REP block) ATOM > is the right decision as opposed to > REP (block ATOM) > right? ... probably not exactly. the highest priority of ATOM is probably also important, as I think of it now... Ruda

Re: [9fans] bison problem, not plan9 related

2009-10-21 Thread Rudolf Sykora
> Is this what you are trying to do? > > $ cat b.y <<'EOF' > %token ATOM REP > %% > blocks: block | block blocks; > block: ATOM | REP block | '[' blocks ']'; > %% > EOF > $ bison b.y > $ My head is starting to spin, but I think that, possibly, yes. Seems to be the simplest way how to do it. :) Any

Re: [9fans] bison problem, not plan9 related

2009-10-21 Thread Rudolf Sykora
I must say, many thanks! Ruda 2009/10/21 Russ Cox : >> Ok, thanks, this seems to have solved it. >> So the %nonassoc says to the parser that >> (REP block) ATOM >> is the right decision as opposed to >> REP (block ATOM) >> right? > > %token declares its arguments as tokens but > does not give them

[9fans] hoc's behaviour, unary operators

2009-10-30 Thread Rudolf Sykora
Hello why 1+-2 is ok for the 'hoc' command, while both 1--2 1-+2 produce a syntax error? (If spaces are added as in 1- -2 1- +2, hoc is fine with the former but still rejects the latter...) Thanks Ruda

Re: [9fans] hoc's behaviour, unary operators

2009-10-30 Thread Rudolf Sykora
PS.: While 'bc' is not any better in this, 'maxima' gets it wright. (Both in linux.)

Re: [9fans] hoc's behaviour, unary operators

2009-10-30 Thread Rudolf Sykora
2009/10/30 Jorden Mauro : > Look under the production for expr in /sys/src/cmd/hoc/hoc.y > > Looks like the unary plus problem would be a one-line fix. The -- with no > space > may be harder to fix. Thanks, I will. Nonetheless, the problem, as I am thinking about it now, could possibly (also) be

Re: [9fans] hoc's behaviour, unary operators

2009-10-30 Thread Rudolf Sykora
2009/10/30 Martin Neubauer : > * Rudolf Sykora (rudolf.syk...@gmail.com) wrote: >> (a-- b wouldn't make sense) it probably can't (can it?) be parsed >> simply with yacc... > I don't see why it would be impossible. Just introduce a binary -- > operator (cf

Re: [9fans] hoc's behaviour, unary operators

2009-10-30 Thread Rudolf Sykora
2009/10/30 erik quanstrom : >> Python handles correctly e.g. 2-7, 2+-+-7, 2+++-7,... >> C-compiler that I use in my linux, gcc, is ok for a+-b and a-+b, also >> for a+-+-b, but not for a++b or a--b or any alike. > > you're confusing tokens and productions.  the c tokenizer > has the following r

  1   2   3   4   5   6   >