ref: 52cacba37c6f3a125ef931afa4b9c2cdb7438fef
parent: 483e54a0d33d6f9237b2af7220d7f384551e67ce
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");
}