On Saturday 2008-04-19 11:35, David C. Rankin wrote:
command line and output:
tmax=0; while read a b t c; do t=$(echo "$t" | sed -e 's/\.//');
sed -e 's/\.//' <<< "$t" oh wait that still involves a pipe... so try these (and enhance your Perl horizons): perl -e '$_=pop;s/\.//;print' "$t" perl -e '$_=pop;y/.//d;print' "$t" perl -e 'print 10*pop' "$t"
if (( $t > $tmax )); then
if [[ "$t" -gt "$tmax" ]]; then
tmax="$t"; fi; done < ./cputemp.log; tmax=$(echo "$tmax" | sed -e 's/\([0-9][0-9]\)\([0-9]\)/\1\.\2/');
perl -le 'split//,pop;print"$_[0]$_[1].$_[2]"' "$tmax" perl -le 'print join".",split/(?<=..)/,pop' "$tmax" perl -le 'print join".",split/(?=.$)/,pop' "$tmax" perl -le 'printf"%u%u.%u",split//,pop' "$tmax" happy perlgolfing.
echo "Max temp is: $tmax"
What say the gurus? Can it be done? I'm just trying to take the good advise and learn.
Guru says implement the whole thing in something non-sh. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org