git: 9front

Download patch

ref: a698c0160cabe63e6a13866fc76146b92658f03e
parent: 493abd4c0f54b70fb4734bdf79e401e28005e3fa
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Sep 22 06:49:48 EDT 2016

sam: make current filename available to shell commands in $f (thanks aiju)

--- a/sys/src/cmd/sam/shell.c
+++ b/sys/src/cmd/sam/shell.c
@@ -93,6 +93,7 @@
 			close(0);	/* so it won't read from terminal */
 			open("/dev/null", 0);
 		}
+		putenv("f", Strtoc(&f->name));
 		execl(SHPATH, SH, "-c", Strtoc(&plan9cmd), nil);
 		exits("exec");
 	}
--