【发布时间】:2015-05-14 02:35:53
【问题描述】:
我有一个 bash 脚本,可以在 Beaglebon Black 中输出 cpu 温度。我需要将这些转换为 javascript。任何擅长 linux 命令和 javascript 的人都知道如何做到这一点?
我正在考虑使用 fs.readfile 命令,但不太确定。
这里是 bash 脚本中的代码和我从哪里得到它的链接:
# CPU TEMP MONITOR
# CTRL-C TO STOP
# WRITTEN BY BRIAN HECKATHORNE - ME@GODFEAR.ORG
# Modified by Richard St-Pierre - inspire.logicsupply.com
# Simple script for monitoring the CPU temp on a BeagleBone Black running Debian
#!/bin/bash
for (( ; ; ))
do
echo -n "CPU Temp [Celsius]: "
cat /sys/class/hwmon/hwmon0/device/temp1_input | sed 's/...$//'
sleep 2
done
【问题讨论】:
-
这个
bash-脚本应该获得useless use ofcataward.。
标签: javascript linux node.js bash