hamza
Posts: 76
Joined: Fri Apr 03, 2015 7:16 pm

fetchmail > /dev/null\

Tue May 19, 2015 11:38 pm

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??

User avatar
rpdom
Posts: 17029
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: fetchmail > /dev/null\

Wed May 20, 2015 8:11 am

Why are you running the bash script as root?

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

hamza
Posts: 76
Joined: Fri Apr 03, 2015 7:16 pm

Re: fetchmail > /dev/null\

Wed May 20, 2015 12:09 pm

How can I run the comnand or script as pi user ??or another user?

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: fetchmail > /dev/null\

Wed May 20, 2015 12:20 pm

How are you running the script?
It should be simply:
./script.sh
There are 10 types of people: those who understand binary and those who don't.

User avatar
rpdom
Posts: 17029
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: fetchmail > /dev/null\

Wed May 20, 2015 12:21 pm

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?

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: fetchmail > /dev/null\

Wed May 20, 2015 12:29 pm

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.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: fetchmail > /dev/null\

Wed May 20, 2015 12:33 pm

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.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: fetchmail > /dev/null\

Wed May 20, 2015 12:49 pm

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?
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: fetchmail > /dev/null\

Wed May 20, 2015 2:22 pm

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).
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: fetchmail > /dev/null\

Wed May 20, 2015 2:41 pm

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.
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

Return to “Beginners”