Executing shell script from Tcl -
i'm attempting run shell script tcl. i'm having bit of trouble though it's not working or giving me error troubleshoot. i'm pretty sure issue coming not having "run" formatted properly. 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 } } }
ended removing run variable , adding directly. works fine now.
set sh "test.sh" set cmd [list sshpass -p 'password' ssh user@ip 'bash -s' \< $sh $arg1 $arg2] if {[catch {eval [linsert $cmd 0 "exec"]} status]} { foreach line [split $status "\n"] { if {[string match *text* $line]} { //do } } }
Comments
Post a Comment