{"id":4345,"date":"2015-11-30T15:51:19","date_gmt":"2015-11-30T15:51:19","guid":{"rendered":"http:\/\/blog.bachi.net\/?p=4345"},"modified":"2015-12-03T13:07:09","modified_gmt":"2015-12-03T13:07:09","slug":"expect","status":"publish","type":"post","link":"https:\/\/blog.bachi.net\/?p=4345","title":{"rendered":"Expect"},"content":{"rendered":"<p><a href=\"http:\/\/expect.sourceforge.net\/\">expect<\/a><br \/>\n<a href=\"http:\/\/www.admin-magazine.com\/Articles\/Automating-with-Expect-Scripts\">Using Expect Scripts to Automate Tasks<\/a><br \/>\n<a href=\"http:\/\/www.thegeekstuff.com\/2010\/10\/expect-examples\/\">6 Expect Script Examples to Expect the Unexpected <\/a><br \/>\n<a href=\"http:\/\/www.thegeekstuff.com\/2011\/01\/expect-expressions-loops-conditions\/\">Expect Script Tutorial: Expressions, If Conditions, For Loop, and While Loop Examples<\/a><br \/>\n<a href=\"https:\/\/wuhrr.wordpress.com\/2011\/03\/12\/tcl-how-to-locate-include-file-to-source\/\">Tcl \u2013 How to Locate Include File to Source<\/a><\/p>\n<h3>User input<\/h3>\n<p><a href=\"http:\/\/stackoverflow.com\/questions\/681928\/how-can-i-make-an-expect-script-prompt-for-a-password\">How can I make an expect script prompt for a password?<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# grab the password\r\nstty -echo\r\nsend_user -- &quot;Password for $user@$host: &quot;\r\nexpect_user -re &quot;(.*)\\n&quot;\r\nsend_user &quot;\\n&quot;\r\nstty echo\r\nset pass $expect_out(1,string)\r\n\r\n#... later\r\nsend -- &quot;$pass\\r&quot;\r\n<\/pre>\n<h3>Tcl<\/h3>\n<p><a href=\"http:\/\/wiki.tcl.tk\/11583\">Expect Examples<\/a><br \/>\n<a href=\"http:\/\/wiki.tcl.tk\/396\">Regular Expressions<\/a><br \/>\n<a href=\"http:\/\/wiki.tcl.tk\/989\">Regular Expression Examples<\/a><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n$ .\/5410debug.exp \r\nbash: .\/5410debug.exp: \/usr\/bin\/expect: bad interpreter: No such file or directory\r\n\r\n$ sudo yum install expect\r\nLoaded plugins: langpacks, refresh-packagekit\r\nResolving Dependencies\r\n--&gt; Running transaction check\r\n---&gt; Package expect.x86_64 0:5.45-10.fc20 will be installed\r\n--&gt; Finished Dependency Resolution\r\n&#x5B;...]\r\nInstalled:\r\n  expect.x86_64 0:5.45-10.fc20\r\nComplete!\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>expect Using Expect Scripts to Automate Tasks 6 Expect Script Examples to Expect the Unexpected Expect Script Tutorial: Expressions, If Conditions, For Loop, and While Loop Examples Tcl \u2013 How to Locate Include File to Source User input How can I make an expect script prompt for a password? # grab the password stty -echo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4345","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/4345","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4345"}],"version-history":[{"count":9,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/4345\/revisions"}],"predecessor-version":[{"id":4362,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=\/wp\/v2\/posts\/4345\/revisions\/4362"}],"wp:attachment":[{"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bachi.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}