|
2010-05-30
, 16:40
|
Posts: 539 |
Thanked: 165 times |
Joined on Feb 2010
@ Berlin, Germany
|
#2
|
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq|tr -d "\n">/userfreq
output : 249600./cpu_curfreq.sh: line 8: 0: command not found
... or even better if someone has the documentation for BusyBox.
The Following User Says Thank You to x-lette For This Useful Post: | ||
|
2010-05-30
, 17:01
|
Posts: 29 |
Thanked: 7 times |
Joined on May 2010
@ Frankfurt, Germany
|
#3
|
VAR=$(cmd)
echo $(( $(cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq) / 1000 )) MHz
The Following User Says Thank You to Manul For This Useful Post: | ||
|
2010-05-30
, 19:03
|
Posts: 11 |
Thanked: 7 times |
Joined on Dec 2009
|
#4
|
|
2010-05-30
, 19:07
|
Posts: 726 |
Thanked: 345 times |
Joined on Apr 2010
@ Sweden
|
#5
|
I've been looking for the Shell documentation of BusyBox which I know has been made from a light Debian Almquist Shell.
I'm trying to make for fun a tiny shell script for a desktop-command widget on my n900 which extract the data from cpu_curfreq:
#!/bin/sh
#Freq extraction, formating and wrinting result into userfrec file
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq|tr -d "\n">/userfreq
#extracting data
Varcurfreq= cat '/userfreq'
result=$(( $Varcurfreq / 1000 ))
echo -n $result
echo " Mhz"
I've found that Dash may be restricted on some operation and I switched to Bash... Anyway I 've got the same problem with the arithmetic division operator "/"
output in dash : 249600./cpu_curfreq.sh: line 8: syntax error: / 1000
I'm kind of a noob and I would really appreciate anyone's help about how to make a division whether in Dash or Bash... or even better if someone has the documentation for BusyBox.
Thank you all Maemoers and future Meegos
Last edited by SneakyC4; 2010-05-30 at 16:33.