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=$TT_bfr=48744874T_afr=1 $ unset T; echo T_bfr=$T; echo $$; { echo $$; export T=1 ; }|cat; echo T_afr=$TT_bfr=48744874T_afr=What is the difference? Why T is missing in the second case?
curly braces and subshell
bash;subshell
The second case is different because that pipe runs in a subshell, where T_aft=$T is unset.