summaryrefslogtreecommitdiff
path: root/sys/src/cmd/sam/shell.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2016-09-22 10:49:48 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2016-09-22 10:49:48 +0200
commit52cacba37c6f3a125ef931afa4b9c2cdb7438fef (patch)
tree0bac5797c253382c036636dc3c6f7934fb14bdb6 /sys/src/cmd/sam/shell.c
parent483e54a0d33d6f9237b2af7220d7f384551e67ce (diff)
sam: make current filename available to shell commands in $f (thanks aiju)
Diffstat (limited to 'sys/src/cmd/sam/shell.c')
-rw-r--r--sys/src/cmd/sam/shell.c1
1 files changed, 1 insertions, 0 deletions
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");
}