Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)



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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: