From 52cacba37c6f3a125ef931afa4b9c2cdb7438fef Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Thu, 22 Sep 2016 10:49:48 +0200 Subject: sam: make current filename available to shell commands in $f (thanks aiju) --- sys/src/cmd/sam/shell.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/src/cmd/sam/shell.c b/sys/src/cmd/sam/shell.c index c0eced359..7c3a0b25c 100644 --- a/sys/src/cmd/sam/shell.c +++ b/sys/src/cmd/sam/shell.c @@ -93,6 +93,7 @@ plan9(File *f, int type, String *s, int nest) 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"); } -- cgit v1.2.3