rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Re:  Bug or feature?
@ 1991-08-19 14:30 Byron Rakitzis
  0 siblings, 0 replies; 3+ messages in thread
From: Byron Rakitzis @ 1991-08-19 14:30 UTC (permalink / raw)
  To: rc

> From: malte@techfak.uni-bielefeld.de
> To: rc@archone.tamu.edu
> Subject: Bug or feature?
> 
> I was just playing around with rc (1.1gamma) and discovered this (strange?)
> behaviour:
> 
> 1) If I define a function fn like "fn fn { printenv | grep '^fn_' }"
>    the output is always nothing and it is impossible to define a new
>    function, because fn now has a different meaning. Bug or feature?

This is not right: fn alone is a keyword parsed by the parser as a
"delete function" command. When you type

; fn

to rc, you are saying "please delete these functions: (no arguments)". Now,
you are free to delete the above definition with

; fn fn

or even to define a new function

; fn foo { echo hi }
; foo
hi
;

I don't see how it's "impossible to define a new function". Is your rc
behaving that way? If so, it's broken and needs to be fixed..

> 2) Why doesn't this work:
>    fn prompt {  if(~ ($status) 1 2 3){
>                 prompt=('err ' '>> ')
>         } else  prompt=('ok ' '>> ')}
>    I want the prompt to show "err " if the last command returned 1,2 or 3,
>    else "ok ".

This works on my machine. Could you please send me a more detailed bug
report? I'll try to fix anything that's wrong...


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re:  Bug or feature?
@ 1991-08-19 15:03 malte
  0 siblings, 0 replies; 3+ messages in thread
From: malte @ 1991-08-19 15:03 UTC (permalink / raw)
  To: rc

I must apologize, maybe I was a bit hasty!

Rc prompts how I told it to, but I'm sure it didn't by the time I wrote my mail
because I double checked it. Maybe this is due to doing all my experiments in
the same shell.
Anyway, my difficulties with setting the prompt aren't reproducible when
using a new instance of rc.

As I understand Byrons answer, there is no way to redefine fn (any builtin?)

Malte



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Bug or feature?
@ 1991-08-19 11:22 malte
  0 siblings, 0 replies; 3+ messages in thread
From: malte @ 1991-08-19 11:22 UTC (permalink / raw)
  To: rc

I was just playing around with rc (1.1gamma) and discovered this (strange?)
behaviour:

1) If I define a function fn like "fn fn { printenv | grep '^fn_' }"
   the output is always nothing and it is impossible to define a new
   function, because fn now has a different meaning. Bug or feature?

2) Why doesn't this work:
   fn prompt {	if(~ ($status) 1 2 3){
		prompt=('err ' '>> ')
	} else	prompt=('ok ' '>> ')}
   I want the prompt to show "err " if the last command returned 1,2 or 3,
   else "ok ".



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1991-08-19 15:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-08-19 14:30 Bug or feature? Byron Rakitzis
  -- strict thread matches above, loose matches on Subject: below --
1991-08-19 15:03 malte
1991-08-19 11:22 malte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).