2 つの文字列に対して tcl exec diff を使用して、tclsh で diff コマンドの同じ出力を生成しようとしています。
tclsh exec diff を使用してこの例を解決する方法を教えてください。
バッシュの操作
$ diff <(echo "Testword") <(echo "Testword2")
1c1
< Testword
---
> Testword2
TCL で失敗しました
set str1 "Testword"
set str2 "Testword2"
最初の試み
% exec diff <(echo "$string1") <(echo "$string2")
extra characters after close-quote
2 回目の試行
% exec diff <(echo \"$string1\") <(echo \"$string2\")
couldn't read file "(echo": no such file or directory
3 回目の試行
% exec diff \<(echo \"$string1\") \<(echo \"$string2\")
couldn't read file "(echo": no such file or directory
4 回目の試行
% set command [concat /usr/bin/diff <(echo \\"$string1\\") <(echo \\"$string2\\")]
/usr/bin/diff <(echo \"Malli\") <(echo \"Malli1\")
% exec $command
couldn't execute "/usr/bin/diff <(echo \"Malli\") <(echo \"Malli1\")": no such file or directory.