I'm attempting to run a shell script from TCL. I'm having a bit of trouble though as it's not working or giving me an error to troubleshoot. I'm pretty sure my issue is coming from not having "run" formatted properly. Any help is appreciated.
set run "sshpass -p 'password' ssh user@ip 'bash -s' <"
set sh "test.sh"
set cmd [list $run $sh $arg1 $arg2]
if {[catch {eval [linsert $cmd 0 "exec"]} status]} {
foreach line [split $status "\n"] {
if {[string match *text* $line]} {
//do something
}
}
}
arg1andarg2are unknown), but tryexec $run $sh $arg1 $arg2instead ofeval [linsert $cmd 0 "exec"].