9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] rc fn weirdness
@ 2021-09-17 16:55 Sigrid Solveig Haflínudóttir
  2021-09-18  2:48 ` Alex Musolino
  0 siblings, 1 reply; 3+ messages in thread
From: Sigrid Solveig Haflínudóttir @ 2021-09-17 16:55 UTC (permalink / raw)
  To: 9front

; fn a/b { echo 123 }
; a/b
rc: can't open /env/fn#a/b: '/env/fn#a' file does not exist
123
; a/b
123
; du -a /env/ | grep '#a'
1    '/env//fn#acid'

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

* Re: [9front] rc fn weirdness
  2021-09-17 16:55 [9front] rc fn weirdness Sigrid Solveig Haflínudóttir
@ 2021-09-18  2:48 ` Alex Musolino
  2021-09-18  3:24   ` ori
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Musolino @ 2021-09-18  2:48 UTC (permalink / raw)
  To: 9front

Quoth Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>:
> ; fn a/b { echo 123 }
> ; a/b
> rc: can't open /env/fn#a/b: '/env/fn#a' file does not exist
> 123
> ; a/b
> 123
> ; du -a /env/ | grep '#a'
> 1    '/env//fn#acid'

Same thing for variables:

; a/b/c = 333
; echo $'a/b/c'
rc: can't open /env/a/b/c: '/env/a' not a directory
333
; echo $'a/b/c'
333
; 

I guess it's not that weird.  It's trying to create a file in a
subdirectory of /env which doesn't exist.  As for why it only
complains about this once, look at /sys/src/cmd/rc/plan9.c:/^addenv;
it sets v->[fn]changed = 0 before trying to create the file under
/env.

The easiest thing to do would just be to disallow '/' in function or
variable names.


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

* Re: [9front] rc fn weirdness
  2021-09-18  2:48 ` Alex Musolino
@ 2021-09-18  3:24   ` ori
  0 siblings, 0 replies; 3+ messages in thread
From: ori @ 2021-09-18  3:24 UTC (permalink / raw)
  To: 9front

Quoth Alex Musolino <alex@musolino.id.au>:
> 
> The easiest thing to do would just be to disallow '/' in function or
> variable names.
> 

I agree that this makes sense.

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

end of thread, other threads:[~2021-09-18  7:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-17 16:55 [9front] rc fn weirdness Sigrid Solveig Haflínudóttir
2021-09-18  2:48 ` Alex Musolino
2021-09-18  3:24   ` ori

9front - general discussion about 9front

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.vuxu.org/9front

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 9front 9front/ https://inbox.vuxu.org/9front \
		9front@9front.org
	public-inbox-index 9front

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.9front


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git