Can Somebody Explain: lm-sensors and sensors-detect...
Odd behavior when invoking/launching sensors-detect from within a BASH script...
The sensors-detect script (Perl) seems to treat the first response as NO; all of the others are YES. The host environment is 2.6.18-164.el5PAE (CentOS). From the console, the behavior is nominal:
...but code the automated code in a BASH script and sensors-detect seems to ignore the first prompt result (treating it as a NO)! I made a modified copy of sensors-detect (sensors-detectYES) that treats the first prompt result as 1 (true, YES, ... whatever) and all seems OK ... it's ugly but it works. Does anybody have an explanation for what's happening? |
Quote:
Code:
/usr/bin/yes YES | /usr/sbin/sensors-detect |
Batting 500
The former approach ("pipe")
Code:
#!/bin/bash The latter Code:
#!/bin/bash Since the pipe technique works (and I understand it ... I swear I did try it that way, earlier ... sigh), that's what I'm going with ("Ship it!"). As to why the latter does not work, I haven't a clue: a learning experience for the future. Thank you for your advice and help! I very much appreciate it. |
Quote:
|
All times are GMT -5. The time now is 07:29 AM. |