I have a bash script which takes one parameter and does something like this:
ssh -t someserver “setenv DISPLAY $1; /usr/bin/someprogram”
How can I force bash to substitute in the $1 instead of passing the literal characters “$1” as the display variable?
Based on your comment on sehe’s answer, it sounds like you just want the remote command to use the local X display — so that the program is running on your remote server (
someserver) but being displayed on the machine you ran thesshcommand on.This can be done by just passing
-X, e.g.For some reason, this doesn’t work with a few programs, for example
evince. I’m not really sure why. I’m pretty sure thatevinceis the only app I’ve had trouble forwarding back over an SSH connection.If this isn’t what you’re aiming to do, please explain.