I am trying to let non-admin users run a script in a shared environment that requires root privileges. I was going to build either an AppleScript or Automator application that invokes expect in order to pass the login credentials (yes, I know the dangers, it will all be execute only). However I get the login to work, but the shell script I am trying to run doesn't seem to be executing, since it returns instantly. I am new to expect and I believe I have an error in my script. Ideas anyone?
#!/usr/bin/expect set timeout 60 set password "MyPass" set command "bash /Applications/mampstack-5.4.36-0/ctlscript.sh start" eval spawn login admin expect "assword:" send "$password\n" expect "$" send "$command\n" expect "$" send exit expect "$" send exit