Further to MvG's answer, you could also use Perl 6:
perl6 -pe .=lc temp
Here $_ is implicit, and you don't need the single quotes to protect it from expansion by the shell ($_ being a special Bash parameter; see: https://www.gnu.org/software/bash/manual/html_node/Special-Parameters.html)