#!/usr/bin/perl -w my $what = $ARGV[0]; unless (defined $what){ print <<"EOF"; Usage: $0 sensor_name EOF exit(1); } open SENSORS, ('){ next unless (/^$what(\s+)?=(\s+)?(.*)!(\-?\d+)!(\-?\d+)$/); my $cmd = $3; $ret = `$cmd`; } print $ret; exit(0);