Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I dont know anything about shell scripting so I do not know what is wrong/right.
...
This is what I am asking. What errors are there?
So, in effect you have pasted whole cloth code presumably written by someone else, and you are asking others to understand it and debug it for you with little effort on your part and without gaining any understanding of it yourself?
That is not how LQ Programming forum should work. The forum is more about sharing knowledge than simply fixing code.
You have been given some excellent pointers by others, but you are going to have to understand how to use that knowledge, and how your script should work, and do your own debugging based on that new understanding.
Again, please review the Site FAQ for guidance in posting your questions and general forum usage. Especially, read the link in that page, How To Ask Questions The Smart Way. The more effort you put into understanding your problem and framing your questions, the better others can help!
While others are always willing to go to some lenghts to help you learn and to resolve your problems, if you are waiting for others to simply do it for you, you may be asking in the wrong place.
well happy is me, someone is thinking out of the box, as I wasn't going to put every way to test.. still that does not change it for me, I still could not test it because why? and for such a detailed script and not knowing how to test it.. well again I am not really wanting to type every little detail about this script and everything on it ... so yeah.. you figure that part out too. cheers!!
In debian, if you do not override the default when you create your user, it will run whatever /bin/sh points at as your shell. It might look like bash, it might act like bash, but it might not BE bash. I rather like the bash extras to tell how many characters are in a string, and to extract a, or a set of, character(s) at a particular position. A lot of which doesn't work in dash.
shellcheck was mentioned several times to you. Why don't you give it a try? You don't need to wait for everyone, it will give you the answer immediately. And you will see the errors.
come back if you fixed all the errors reported by shellcheck - or if you have problem fixing any of them.
shellcheck isnt giving me any error that is wrong with the script; The script runs.
Also no #! at the top of the script. If you're running it ./, then it wont know what shell to use. And systems default to different shells. Like debian defaults to dash, bsd to tch?, and other quirks.
Yup, forgot about that one. It defaulted to the default share and worked but I forgot it is needed.
Quote:
Originally Posted by Shadow_7
Also, if you "require" external programs, why not check for them in the script instead of being lazy and having a comment that it is required?
Code:
if [[ ! $(which ipmi) ]]; then
echo "ipmi NOT detected"
exit 1
fi
Then, review the file /tmp/r710fanscript.out after the job runs to determine what's happening; in this case looks like you want to run every 5-minutes.
This will help fix any errors. After all issues are resolved, change the crontab entry back to /dev/null...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.