Hi,

On Mon, 13 Mar 2006 20:14:33 +0000 (WET)
Jorge Almeida <[EMAIL PROTECTED]> wrote:

> I want something like this:
> myvar="whatever" ssh [EMAIL PROTECTED] ./bin/mycommand $myvar
> [...]
> This does not work, because remotebox doesn't know about $myvar. Of
> course, if I could pass a variable to remotebox, the line might be just
> command="~/bin/mycommand" <public-key>
> and the ssh command would be
> myvar="whatever" ssh [EMAIL PROTECTED] ./bin/mycommand
> (the program itself would use the value of $myvar)

Hm, I think you're making it unnecessary complex. What's wrong with
just piping it on stdin? I.e.:

local$ echo "whatever" | ssh [EMAIL PROTECTED] ./bin/mycommand
and in ./bin/mycommand:
---
#!/bin/sh
read myvar
# do whatever
---

Or do you in fact use a pseudo tty on remote side for interactive mode
(which would make this a little more difficult)?

If you want to keep your way of doing it, I just have a few hints, but
didn't test anything, just looked them up out of curiosity:
- read "man sshd_config", item AcceptEnv, PermitUserEnvironment
- read "man sshd", section LOGIN PROCESS

-hwh
-- 
gentoo-user@gentoo.org mailing list

Reply via email to