Created
February 28, 2014 14:13
-
-
Save felixkiss/9271755 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "sterreich" | |
echo "sterreich"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php test.php | |
Last login: Fri Feb 28 15:11:46 2014 from localhost | |
mbp-felix:~ foo$ echo "This is a test" | |
This is a test | |
mbp-felix:~ foo$ | |
LANG= | |
LC_COLLATE="C" | |
LC_CTYPE="C" | |
LC_MESSAGES="C" | |
LC_MONETARY="C" | |
LC_NUMERIC="C" | |
LC_TIME="C" | |
LC_ALL= | |
Österreich äöüß | |
echo "Österreich" | |
Last login: Fri Feb 28 15:12:31 2014 from localhost | |
mbp-felix:~ foo$ echo "sterreich" | |
sterreich | |
mbp-felix:~ foo$ % |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
$ssh = new Net_SSH2('127.0.0.1'); | |
$ssh->setTimeout(10); | |
if (!$ssh->login('foo', 'foo')) | |
{ | |
throw new Exception('Could not login to SSH server.'); | |
} | |
echo $ssh->read('mbp-felix:~ foo$ '); | |
$ssh->write('echo "This is a test"' . "\n"); | |
echo $ssh->read('mbp-felix:~ foo$ '); | |
echo "\n\n"; | |
echo $ssh->exec('locale'); | |
echo $ssh->exec('echo "Österreich äöüß"'); | |
echo "\n\n"; | |
$ssh->write('echo "Österreich"' . "\n"); | |
echo $ssh->read('mbp-felix:~ foo$ '); | |
$ssh->write('echo "äöüß"' . "\n"); | |
echo $ssh->read('mbp-felix:~ foo$ '); | |
$ssh->disconnect(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment