sveinbjornt / Platypus

Create native Mac applications from command line scripts.
https://sveinbjorn.org/platypus
BSD 3-Clause "New" or "Revised" License
2.84k stars 171 forks source link

autoresponder with expect not working #239

Open franklin-gedler opened 2 years ago

franklin-gedler commented 2 years ago

I have a script_1 in bash which executes a script_2 in bash but using expect

/usr/bin/expect -c " set timeout 1 spawn su - $usr -c '/tmp/script_2' expect \"Password: \" send \"$pass\r\" interact " $usr and $pass I capture them with osascript inside script_1 when executing the app it executes the line: spawn su - $usr -c '/tmp/script_2' but it waits about 10 seconds then it shows the output "Password: " and immediately the app finishes the execution.

It will be that platypus when detecting a stdin signal automatically cuts the execution of the app? can expect be used inside app built with platypus?

script_1 is executed with a user1, then inside script_1 it executes expect to call script_2 but with the environment of another user, which would be user2