php - phpseclib, using double slashes -
ok have line,
$ssh->exec('cd e:\\titan\ torque\\jobs');
now how use double slashes? mean need 2 slashes sent not 1 command:
cd e:\\titan\ torque\\jobs
is need executed.
p.s. ssh server running on windows, command runs fine in putty php stripping down to:
cd e:\titan\ torque\jobs
any appreciated.
i think if escape backslashes backslashes, should work.
$ssh->exec('cd e:\\\\titan\\ torque\\\\jobs');
in test:
echo 'e\\:a thing with\slashes\\'; echo "\n"; echo 'e\\\\:a thing with\\\\slashes\\';
gives
e\:a thing with\slashes\ e\\:a thing with\\slashes\
in case you're curious, reason single backslash works @ all, because \
isn't special escape sequence it's put resultant string literally.
Comments
Post a Comment