Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: "Remote" execution - is this possible?



On Thu, 31 Mar 2011, Helmut Jarausch wrote:

Hi,

on a remote machine to which I have root access I'd like to fix some environment setting for running zsh processes, i.e.

there are some xterms running zsh.

I'd like to achieve the effect as if a local user had entered
export BROWSER=firefox
in his xterm.

Is this possible?

No. The environment in which a process starts is typically passed to the main routine. You can't simply modify it after the program has started.

What are you trying to achieve with the 'export BROWSER=firefox'?

If you're calling some kind of URL-launcher (looks like something you'd need for `xdg-open` or such), you could modify the launcher to set that variable if none is passed in.

Even better, if your running zsh'es have something like ~/bin/ in their path, you could insert a wrapper program:

e.g. I have:

$ cat ~/bin/xdg-open
#!/bin/zsh
exec chromium -remote $argv

(In your case, sounds like you'd want 'firefox' where I have 'chromium')

Otherwise, let us know what you're trying to do, rather than how you want to accomplish it.

--
Best,
Ben



Messages sorted by: Reverse Date, Date, Thread, Author