எக்சுபெக்ட்
Jump to navigation
Jump to search
எக்சுபெக்ட் என்பது கணினி பிணையத்தில் பல்வேறு ஊடாடல் பணிகளை தன்னியக்கமாக ஆக்க உதவும் ஒரு நிரல் மொழி ஆகும். இதன் முதல் வடிவம் டி.சி.எல் மொழியில் நீட்சியாக எழுதப்பட்டது. தற்போது பெர்ள், பைத்தோன் மொழிகளிலும் இந்த மொழிக்கான பொதிகள் உள்ளன.[1][2][3]
முக்கிய கட்டளைகள்
- expect
- send
- spawn
பெர்ள் எடுத்துக்காட்டு
#!/usr/bin/perl
use strict;
use warnings;
use Expect;
my $exp = new Expect();
my $timeout = 4;
my $expect_log = "test.txt";
$exp->spawn("ssh abc\@example.com");
$exp->expect($timeout, 'Password:');
$exp->send("password\n");
$exp->expect($timeout, '/^turo(.*)$/');
$exp->log_file("$expect_log");
$exp->send("ls -la \n");
$exp->expect($timeout, '/^servername(.*)$/');
# open(FH_test, ">$expect_log") or die ("Can not open");
$exp->send("exit\r");
$exp->soft_close();
மேற்கோள்கள்
- ↑ "Expect FAQ: Our company policy requires a license to use Expect. Where can we get a license?". 2006-10-11.
- ↑ Nemeth, Evi; Snyder, Garth; Seebass, Scott; Hein, Trent (2000-08-29). UNIX System Administration Handbook (in ஆங்கிலம்). Pearson Education. ISBN 978-0-13-700291-7.
- ↑ Mckay, David (May 24, 2021) [May 24, 2021]. "Automate Inputs to Linux Scripts With the expect Command". category/Linux (in ஆங்கிலம்). Retrieved Nov 28, 2023.
{{cite web}}: CS1 maint: date and year (link)