1

いくつかのオプションがあり、入力 txt ファイルとして受け取るプログラムを実行しようとしています。だから私はこれを試しました:

set myExecutable [file join $::env(path_to_the_program) bin executable_name] 
if { ![file exists $myExecutable ] } {
puts "error"
}

if { ![file executable $myExecutable ] } {
puts "error"
}


set arguments [list -option1 -option2]
set status [catch { exec $myExecutable $arguments  $txtFileName } output]
if { $status != 0 } {
    puts "output = $output"
}

だからそれは印刷です:

output = Usage: executable_name -option1 -option2 <txt_file_name>
child process exited abnormally
4

1 に答える 1