nan0s7 / nfancurve

A small and lightweight POSIX script for using a custom fan curve in Linux for those with an Nvidia GPU.
GNU General Public License v3.0
315 stars 58 forks source link

Syntax error: "(" unexpected #5

Closed jBachalo closed 5 years ago

jBachalo commented 5 years ago

Hi With latest (and also earlier) versions of nfancurve I repeatedly get the following errors when I try and run temp.sh

./temp.sh: 45: ./temp.sh: Syntax error: "(" unexpected ./temp.sh: 33: ./temp.sh: set_fan_control: not found

Line 45 reads declare -a temp=()

Any suggestions? I'm in Ubuntu 18.04.

varomix commented 5 years ago

I'm running it in Ubuntu 18.04 and it runs ok oh I know what you are doing sh temp.sh don't run it like that, run it like this ./temp.sh

just like the docs say

sh runs it as SHELL, it needs to run as BASH

Cheers!

jBachalo commented 5 years ago

Thanks! Is it necessary to create a .desktop file and link to this, or can you target this script directly as a startup application in Ubuntu? Just having a problem getting this to autorun in the background

varomix commented 5 years ago

I wasn't able to make it auto run, so I only run it when I'm GPU rendering

On Fri, Sep 28, 2018, 2:43 PM jBachalo notifications@github.com wrote:

Thanks! Is it necessary to create a .desktop file and link to this, or can you target this script directly as a startup application in Ubuntu? Just having a problem getting this to autorun in the background

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/nan0s7/nfancurve/issues/5#issuecomment-425560344, or mute the thread https://github.com/notifications/unsubscribe-auth/AAsb-71RLetHPrEufDy3NxYFaLQqbjMIks5ufooEgaJpZM4W9wdR .

nan0s7 commented 5 years ago

Hey sorry about the late reply. @jBachalo are you having trouble with the desktop file itself? You can check if it works by just running the desktop file and everything should work if done correctly. However, it could be a problem with my update script, so if the desktop file doesn't work; open a terminal to where you have my script stored, and run the update script (./update.sh) and it should start a background process. If it doesn't, let me know.

If that doesn't work, just try nohup ./temp.sh >/dev/null 2>&1 &. You can check if the process is running by running htop, press F4 and type "temp" and it should show the process there.

If your desktop file doesn't work, paste the contents of it here so I can make sure it's all good. Also, make sure to put the desktop file in your /home/user/.config/autostart/ folder (where user is your user account name).

nan0s7 commented 5 years ago

If anyone wants to help improve either the documentation or has some sort of problem/difficulty with setting up the script to automatically run upon boot, please let me know.

Otherwise I'll be closing this issue in a month. :)