On Sun, Aug 05, 2012 at 12:18:24PM +0000, Sean Estabrooks wrote:
> #!/bin/bash
> A="HELLO"
> B="WORLD"
> upgradecommand="echo $A $B \$SSH_CONNECTION; cat /etc/passwd; sleep 5"
> quoted=$(printf '%q' "$upgradecommand")
> tmux new-window -d -t mysession: -n window-remotehost "ssh remotehost 
> ${quoted}"

Thank you Sean, I didn't know of %q (it actually isn't documented for my
distribution). Can this be considered "safe"? (many shells out there,
and I fear proper escaping is not a clearly defined task)

Another hack I found is something like:

tmux set-environment mycommand "hostname ; hostname ; sleep 5" \; \
     new-window -d "ssh remotehost \"\$mycommand\"" \; \
     set-environment -u mycommand
     
But doesn't scale to n redirections, and isn't very clean either...

Have a nice day
-Jens Stimpfle

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to