シェル環境変数PATH_TO_DIR
があり、ファイルが存在することをTCLスクリプトでチェックインしたいと思います$PATH_TO_DIR/target.txt
。
私の現在の解決策は次のとおりです。
catch {exec /usr/local/bin/tcsh -c "echo $PATH_TO_DIR/target.txt" } result
if {![file exists $result]} {
puts "ERROR: the file $result is not exists"
}
もっとエレガントな方法があると確信しています。
TCLコマンドだけで解決するにはどうすればよいですか?