Commands like sftp work in a way that it’s not possible to pipe in user input (ex:password etc…)
Q1: How does sftp achieve this?
Q2: How do programs like expect get around this restriction?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
sftp reads input from the controlling terminal rather than just from the standard input. Expect and similar get around it by creating a pseudo-terminal under their control and making that the controlling terminal of the process they are talking to.