What is the purpose of the following command?
sudo echo t > /proc/sysrq-trigger
I run it, but I can see no difference in the magic key and its output at dmesg. Trigger suggests me that the databases of sysrq are involved in the process.
according to this site - red hat manual -> proc-sysrq-trigger - you can use this to remotly (for example in an ssh session) execute the magic system request keys.
it makes sense because otherwise, if you have to perform such an task and you're not in reach for the server or the server has no keyboard attached, you can't trigger system request keys.
your example does not work because of different problems.
you have to do this like the examples on this site - a full example would be:
After i wrote all this i catched probably another issue of your test :). if you execute for example the "t" sysrq key over an remote session or for example an xterm you can't see the output because sysrq output goes to the "real" console. issue dmesg to see the output!