LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-05-2007, 03:08 PM   #1
brain_bashed
LQ Newbie
 
Registered: Sep 2007
Posts: 4

Rep: Reputation: 0
need help with a fan control script


Hello everyone!

I have a thinkpad t43 and i'm trying to run tp-fancontrol to lower the fan speeds cause its just too loud.

On that wiki page it says i have to change a kernel parameter for ibm-acpi.experimental to 1 so in my /etc/sysctrl.conf i added the line
PHP Code:
ibm-acpi.experimental=
is there a way to check that it's working?

second, when i try to run the script i get syntax errors:

PHP Code:
tp-fancontrolline 201syntax error near unexpected token `<'
tp-fancontrol: line 201: 
`    read X Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 Z1 Z2 Z3 JNK < <(echo "$THERMAL"
these are the lines around the errors..
PHP Code:
197 thermometer() { # output list of temperatures
198 # 8 basic temperatures from ibm-acpi:
199 [[ -r $IBM_ACPI/thermal ]] || { echo "$0: Cannot read $IBM_ACPI/thermal" 2>&; exit 1; }
200 read THERMAL $IBM_ACPI/thermal
201 read X Y1 Y2 Y3 Y4 Y5 Y6 Y7 Y8 Z1 Z2 Z3 JNK 
< <(echo "$THERMAL"
202 [[ "$X== "temperatures:" ]] || { echo "$0: Bad readout: \"$THERMAL\"" >&2;  exit 1; }
203 echo -"$Y1 $Y2 $Y3 $Y4 $Y5 $Y6 $Y7 $Y8 "
i'm running ubuntu 6.06 with kernel version 2.6.15-29-386. I have no bash coding experience so i'm completely lost, if any of you guys could help i'd really appreciate it! thanks!

Last edited by brain_bashed; 09-05-2007 at 04:04 PM.
 
Old 09-05-2007, 03:59 PM   #2
jozyba
Member
 
Registered: Sep 2007
Distribution: Debian Etch, Lenny, Lenny/Sid
Posts: 31

Rep: Reputation: 15
Shouldn't line 200 be:
Code:
read THERMAL < $IBM_ACPI/thermal
$IBM_ACPI looks like the path to a directory whereas you want to read the contents of the file that is in that directory.
 
Old 09-05-2007, 04:06 PM   #3
brain_bashed
LQ Newbie
 
Registered: Sep 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Yes, you are right. i deleted that when i was hacking away at the script trying to make it work. I edited my post above to include: /thermal

thanks for picking that up! I still get the same syntax errors though..
 
Old 09-05-2007, 04:36 PM   #4
jozyba
Member
 
Registered: Sep 2007
Distribution: Debian Etch, Lenny, Lenny/Sid
Posts: 31

Rep: Reputation: 15
I did a mock-up of the few lines of code that you gave us and it works fine in a bash shell.

Then I saw that you're using Ubuntu. I seem to remember that they recently changed the symbolic link of /bin/sh from bash to dash. Your script would work with bash but not with dash.

Does the first line of your script say '#! /bin/sh' by any chance? If so, try changing it to '#! /bin/bash'
 
Old 09-05-2007, 04:45 PM   #5
brain_bashed
LQ Newbie
 
Registered: Sep 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jozyba View Post
Does the first line of your script say '#! /bin/sh' by any chance? If so, try changing it to '#! /bin/bash'
Nope, it says #!/bin/bash
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can see a fan with lm_sensors but not control it hedpe Linux - Software 1 02-10-2006 01:06 PM
Fan Control? halfpower *BSD 3 09-07-2005 12:23 AM
howto: control CPU fan speed and Northbridge fan speed? hedpe Linux - Software 2 04-18-2005 02:18 AM
fan control in acpi chunlee Linux - Newbie 0 11-16-2004 06:41 AM
fan control zovres Linux - General 4 07-17-2004 01:06 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration