From f7aae7433080bd5f25e7ef2f5f1314c84024c366 Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Sun, 18 Mar 2012 04:11:49 -0400 Subject: [PATCH] Use shell to run command (so PATH is searched) --- scripts/mosh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/mosh b/scripts/mosh index d1baaee..ceb641e 100755 --- a/scripts/mosh +++ b/scripts/mosh @@ -178,7 +178,8 @@ if ( $pid == 0 ) { # child } if ( scalar @command > 0 ) { - push @server, ( '--', @command ); + my $command_string = q{"} . (join ' ', @command) . q{"}; + push @server, ( '--', '/bin/sh', '-c', $command_string ); } exec 'ssh', '-S', 'none', '-o', "ProxyCommand=$0 --fake-proxy -- %h %p", '-t', $userhost, '--', @server;