I am trying to produce same output of diff command in tclsh using tcl exec diff on two strings.
Could you please let me know how to solve this example using tclsh exec diff
Working with Bash
$ diff <(echo "Testword") <(echo "Testword2")
1c1
< Testword
---
> Testword2
Failed on TCL
set str1 "Testword"
set str2 "Testword2"
First attempt
% exec diff <(echo "$string1") <(echo "$string2")
extra characters after close-quote
Second attempt
% exec diff <(echo \"$string1\") <(echo \"$string2\")
couldn't read file "(echo": no such file or directory
Third attempt
% exec diff \<(echo \"$string1\") \<(echo \"$string2\")
couldn't read file "(echo": no such file or directory
Fourth attempt
% 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.