{"id":2235,"date":"2017-12-08T05:25:57","date_gmt":"2017-12-08T05:25:57","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=2235"},"modified":"2022-04-24T04:21:19","modified_gmt":"2022-04-24T04:21:19","slug":"expect-command-in-unix-linux","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/expect-command-in-unix-linux\/","title":{"rendered":"Linux Tutorials: expect commands examples"},"content":{"rendered":"<p><strong>scmuser created the topic: expect command in unix \/linux?<\/strong><br \/>\nHello,<br \/>\nI am doing a project which asks me to enter password 4 times in a row. I need to enter the same password 4 times. My target is to enter password once and apply it 4 times.<br \/>\nMy friend told me to use &#8220;expect&#8221; command. Can you please give me a sample code to do so.<\/p>\n<p>sample command :- $ ssh @(like :ssh root@127.0.0.1)<br \/>\nenter &#8216;s password:<\/p>\n<p>Could somebody plz tell me where the command &#8220;expect&#8221; is used. and wud appreciate if you can write a simple standalone script that uses this command. thanks<\/p>\n<p><strong>rajeshkumar replied the topic: Re: expect command in unix \/linux?<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>scmuser created the topic: expect command in unix \/linux? Hello, I am doing a project which asks me to enter password 4 times in a row. I need to enter&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[454],"tags":[333],"class_list":["post-2235","post","type-post","status-publish","format-standard","hentry","category-shell-script","tag-command"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=2235"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2235\/revisions"}],"predecessor-version":[{"id":29686,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2235\/revisions\/29686"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=2235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=2235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=2235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}