Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mortenlarsen
on Sept 27, 2022
|
parent
|
context
|
favorite
| on:
The minimum viable fan control script
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)
0xCAP
on Sept 27, 2022
|
next
[–]
A classic example of cat abuse in my book.
elsyx
on Sept 27, 2022
|
parent
|
next
[–]
Definitely an unwarranted cat call.
deeblering4
on Sept 27, 2022
|
parent
|
prev
|
next
[–]
meow
piperswe
on Sept 27, 2022
|
prev
[–]
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:
> temp=$(cat /sys/class/thermal/thermal_zone1/temp)
temp=$(</sys/class/thermal/thermal_zone1/temp)