I want to write a shell program in windows that runs another shell script and expects a password prompt from the Git bash terminal and inputs it. This is what I have so far:
#!/bin/sh
# \
exec tclsh "$0" ${1+"$@"}
package require Expect
spawn sampleScript.sh
expect "Password:"
send "pass123"
sampleScript.sh code:
echo 'Hello, world.' >foo.txt
my program outputs the following:
'The operation completed successfully. while executing "spawn sampleScript.sh"
(file "compare.tcl" line 6)'
However, there is no foo.txt that is created in my local file folder where the scripts are. Can you help?