9front - general discussion about 9front
 help / color / mirror / Atom feed
* file name from sam !
@ 2016-09-22  8:09 Julius Schmidt
  2016-09-22  8:50 ` [9front] " cinap_lenrek
  2016-09-22  9:03 ` cinap_lenrek
  0 siblings, 2 replies; 5+ messages in thread
From: Julius Schmidt @ 2016-09-22  8:09 UTC (permalink / raw)
  To: 9front

would be nice if there was a feature along the lines of having sam set an 
env variable $f with the current file name so you can do things like

! chmod +x $f

without having to retype the filename.

maybe this already exists and i just don't know :)


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

* Re: [9front] file name from sam !
  2016-09-22  8:09 file name from sam ! Julius Schmidt
@ 2016-09-22  8:50 ` cinap_lenrek
  2016-09-22  9:03 ` cinap_lenrek
  1 sibling, 0 replies; 5+ messages in thread
From: cinap_lenrek @ 2016-09-22  8:50 UTC (permalink / raw)
  To: 9front

diff -r 9319c4c3a2f1 sys/src/cmd/sam/shell.c
--- a/sys/src/cmd/sam/shell.c	Wed Sep 21 21:57:08 2016 +0200
+++ b/sys/src/cmd/sam/shell.c	Thu Sep 22 10:48:46 2016 +0200
@@ -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");
 	}

--
cinap


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

* Re: [9front] file name from sam !
  2016-09-22  8:09 file name from sam ! Julius Schmidt
  2016-09-22  8:50 ` [9front] " cinap_lenrek
@ 2016-09-22  9:03 ` cinap_lenrek
  2016-09-22  9:04   ` Siarhei Zirukin
  1 sibling, 1 reply; 5+ messages in thread
From: cinap_lenrek @ 2016-09-22  9:03 UTC (permalink / raw)
  To: 9front

interestingly, acme has $% for this. might change it for
sam as well?

--
cinap


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

* Re: [9front] file name from sam !
  2016-09-22  9:03 ` cinap_lenrek
@ 2016-09-22  9:04   ` Siarhei Zirukin
  2016-09-22  9:05     ` cinap_lenrek
  0 siblings, 1 reply; 5+ messages in thread
From: Siarhei Zirukin @ 2016-09-22  9:04 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 210 bytes --]

Yes, please. $% seems safer for the environment.

On Thu, Sep 22, 2016 at 11:03 AM, <cinap_lenrek@felloff.net> wrote:

> interestingly, acme has $% for this. might change it for
> sam as well?
>
> --
> cinap
>

[-- Attachment #2: Type: text/html, Size: 524 bytes --]

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

* Re: [9front] file name from sam !
  2016-09-22  9:04   ` Siarhei Zirukin
@ 2016-09-22  9:05     ` cinap_lenrek
  0 siblings, 0 replies; 5+ messages in thread
From: cinap_lenrek @ 2016-09-22  9:05 UTC (permalink / raw)
  To: 9front

done :-)

--
cinap


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

end of thread, other threads:[~2016-09-22  9:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-22  8:09 file name from sam ! Julius Schmidt
2016-09-22  8:50 ` [9front] " cinap_lenrek
2016-09-22  9:03 ` cinap_lenrek
2016-09-22  9:04   ` Siarhei Zirukin
2016-09-22  9:05     ` cinap_lenrek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).