I can't figure it out. As I read in documentaion, {}
doesn't create a subshell. However, looks like that sometimes it does:
$ unset T; echo "T_bfr=$T"; echo $$; { echo $$; export T=1; }; echo "T_afr=$T"
T_bfr=
4874
4874
T_afr=1
$ unset T; echo "T_bfr=$T"; echo $$; { echo $$; export T=1 ; }|cat; echo "T_afr=$T"
T_bfr=
4874
4874
T_afr=
What is the difference? Why T is missing in the second case?