{"id":169,"date":"2012-01-23T12:32:39","date_gmt":"2012-01-23T17:32:39","guid":{"rendered":"https:\/\/www.vhdesigns.com\/?p=169"},"modified":"2012-01-23T12:32:39","modified_gmt":"2012-01-23T17:32:39","slug":"6-expect-script-examples-to-expect-the-unexpected-with-hello-world","status":"publish","type":"post","link":"https:\/\/vhdesigns.com\/index.php\/2012\/01\/23\/6-expect-script-examples-to-expect-the-unexpected-with-hello-world\/","title":{"rendered":"6 Expect Script Examples to Expect the Unexpected (With Hello World)"},"content":{"rendered":"<p><a href=\"http:\/\/www.thegeekstuff.com\/2010\/10\/expect-examples\/\">6 Expect Script Examples to Expect the Unexpected (With Hello World)<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 1.571em; margin-left: 0px; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; background-color: #ffffff; padding: 0px;\">Expect scripting language is used to feed input automatically to an interactive program. It is easy to learn compared to other scripting languages. Using expect script sysadmins and developers can automate redundant tasks easily. It works by expecting specific strings, and sending or responding strings accordingly.<\/p>\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 1.571em; margin-left: 0px; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; background-color: #ffffff; padding: 0px;\">Following three expect commands are used when automating any interactive processes.<\/p>\n<ul style=\"margin-bottom: 1.571em; margin-left: 1.571em; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; background-color: #ffffff; padding: 0px;\">\n<li style=\"padding: 0px; margin: 0px;\">send \u2013 to send the strings to the process<\/li>\n<li style=\"padding: 0px; margin: 0px;\">expect \u2013 wait for the specific string from the process<\/li>\n<li style=\"padding: 0px; margin: 0px;\">spawn \u2013 to start the command<\/li>\n<\/ul>\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 1.571em; margin-left: 0px; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; background-color: #ffffff; padding: 0px;\">\n<p style=\"margin-top: 0px; margin-right: 0px; margin-bottom: 1.571em; margin-left: 0px; color: #111111; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 22px; background-color: #ffffff; padding: 0px;\">Make sure to install expect packages on your system, as it does not get installed by default. Once installed, you\u2019ll see the expect interpreter as \u201c\/usr\/bin\/expect\u201d. Generally, expect script files has .exp as extensions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>6 Expect Script Examples to Expect the Unexpected (With Hello World). &nbsp; Expect scripting language is used to feed input automatically to an interactive program.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-169","post","type-post","status-publish","format-standard","hentry","category-internet"],"_links":{"self":[{"href":"https:\/\/vhdesigns.com\/index.php\/wp-json\/wp\/v2\/posts\/169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vhdesigns.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vhdesigns.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vhdesigns.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/vhdesigns.com\/index.php\/wp-json\/wp\/v2\/comments?post=169"}],"version-history":[{"count":0,"href":"https:\/\/vhdesigns.com\/index.php\/wp-json\/wp\/v2\/posts\/169\/revisions"}],"wp:attachment":[{"href":"https:\/\/vhdesigns.com\/index.php\/wp-json\/wp\/v2\/media?parent=169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vhdesigns.com\/index.php\/wp-json\/wp\/v2\/categories?post=169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vhdesigns.com\/index.php\/wp-json\/wp\/v2\/tags?post=169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}