I am new to linux and scripting. I am trying to execute the following but would like to see what is happening here, in the first line - #!/usr/bin/expect , do i need to install/download any libraries for this. I am guessing expect is a tool we can use, but probably need to install it first before using it, right? is spawn a inbuilt command ? what about sftp?
1. #!/usr/bin/expect
2. export PASSWORD="*******"
3. expect -c 'spawn sftp user@site.com;
expect "*Password: ";
send "$env(PASSWORD)\r";
expect "sftp>";
send "get some_file.txt \r";