Hacker News new | ask | show | jobs
by mortenlarsen 1358 days ago
There is no need to call cat to read from a file.

> temp=$(cat /sys/class/thermal/thermal_zone1/temp)

temp=$(</sys/class/thermal/thermal_zone1/temp)

2 comments

A classic example of cat abuse in my book.
Definitely an unwarranted cat call.
meow
IMO the cat version is more readable, and any performance difference should be negligible