Page 1 of 1

fetchmail > /dev/null\

Posted: Tue May 19, 2015 11:38 pm
by hamza
hi

i execute ed this command using command terminal
fetchmail > /dev/null\
and it is working correctly, but when I but put it inside bash scrpit, then it give me the following error
fetchmail: WARNING: Running as root is discouraged.
fetchmail: no mailservers have been specified.


#!/bin/bash
fetchmail > /dev/null

so, what is the correct command way inside bash??

Re: fetchmail > /dev/null\

Posted: Wed May 20, 2015 8:11 am
by rpdom
Why are you running the bash script as root?

What is wrong with just running it as "pi" (or your normal user)?

Re: fetchmail > /dev/null\

Posted: Wed May 20, 2015 12:09 pm
by hamza
How can I run the comnand or script as pi user ??or another user?

Re: fetchmail > /dev/null\

Posted: Wed May 20, 2015 12:20 pm
by kusti8
How are you running the script?
It should be simply:
./script.sh

Re: fetchmail > /dev/null\

Posted: Wed May 20, 2015 12:21 pm
by rpdom
Um, you just run it.

You'd need to be doing something different to run it as root or another user, like using sudo for example.

How are you running the script and the command at the moment?

Re: fetchmail > /dev/null\

Posted: Wed May 20, 2015 12:29 pm
by Joe Schmoe
I think a lot of people get the impression (from reading the posts on this board) that if anything at all goes wrong with a command, putting "sudo" in front of it will fix it.

Re: fetchmail > /dev/null\

Posted: Wed May 20, 2015 12:33 pm
by pluggy
Joe Schmoe wrote:I think a lot of people get the impression (from reading the posts on this board) that if anything at all goes wrong with a command, putting "sudo" in front of it will fix it.
I think a lot of people just put sudo in front of commands irrespective whether it works or not as a standard user.

Re: fetchmail > /dev/null\

Posted: Wed May 20, 2015 12:49 pm
by Joe Schmoe
pluggy wrote:
Joe Schmoe wrote:I think a lot of people get the impression (from reading the posts on this board) that if anything at all goes wrong with a command, putting "sudo" in front of it will fix it.
I think a lot of people just put sudo in front of commands irrespective whether it works or not as a standard user.
Quite so. Why mess around?

Re: fetchmail > /dev/null\

Posted: Wed May 20, 2015 2:22 pm
by pluggy
Joe Schmoe wrote:
pluggy wrote:
Joe Schmoe wrote:I think a lot of people get the impression (from reading the posts on this board) that if anything at all goes wrong with a command, putting "sudo" in front of it will fix it.
I think a lot of people just put sudo in front of commands irrespective whether it works or not as a standard user.
Quite so. Why mess around?
Because sometimes the application doesn't like being run as root ? (which brings us nicely back to square one).

Re: fetchmail > /dev/null\

Posted: Wed May 20, 2015 2:41 pm
by Joe Schmoe
Because sometimes the application doesn't like being run as root ? (which brings us nicely back to square one).
It was a joke.

It's like what I call "The kill -9 problem". Once people learn about "kill -9", they never use anything else...

I could write an essay about "kill -9", but suffice it to say that the range of cases where "kill -9" works and ordinary "kill" doesn't, is actually pretty small.