Set Proxy for Linux server by bash script failed [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I use the command below to set proxy in command line and it succeed:
export http_proxy="http://proxy.company.com:8080/"
But When I use a bash script, below is the content of the script
export http_proxy="http://proxy.company.com:8080/"
export https_proxy="http://proxy.company.com:8080/"
sudo yum list
And it failed.
Can anyone tell me the difference?
Thanks.

sudo doesn't respect current user variables. You must use sudo -E to preserve current variables. Or you can set the proxy in /etc/yum.conf.

Related

Accidental echo [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
When I was setting up my Ubuntu environment, I think I mistyped and did something like this:
echo 'srouce /opt/whatever'
And now when I open terminal, the first line is always:
srouce: command not found
How can I get fix this issue?
Fix the misspelling in your shell startup files:
sed -i 's/srouce/source/' .bashrc .profile

linux - adding a user [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have this code but it is not compiling correctly. I want to create a user with a default shell of bin/sh with the group adults. Any suggestions?
Command: useradd -s /bin/sh –g adults michael
Thank you.
First of all the code given is not being compiled, but rather executed by a shell. Then your command is perfectly fine, given that the adults group already exists before you type the command into your shell.
So without error, or more context, nobody will be able to tell you more than what I'm telling you:
there's no issue with your command.

bash: ./checksetup.pl: No such file or directory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
While installation of bugzilla I was running this commmand, /.checksetup.pl , but I am getting the error,
bash: ./checksetup.pl: No such file or directory
I am using centos v6.5.
check if you in the right place (u can use 'ls' command and see if it's showing 'checksetup.pl' )
it might be not executable ,then try this :
sudo chmod +x checksetup.pl

How can I store my own path in cygwin? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
It's always a bit tedious to go from $HOME to some directory to run something, so is there a way I can save a directory to like $MYPATH and do cd $MYPATH from anywhere?
This is what you want http://cygwin.com/cygwin-ug-net/setup-env.html
so everytime you start a session you can
export MYPATH="path where you want to go to"
alternatively you can save the above line in the ~/.bashrc this way when you start a new session, the variable is set automatically

changing users default login shell on RHEL? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Here is a command on free bsd
sudo pw usermod ksbuild -s /usr/local/bin/bash
how do I do the equivalent on RHEL?
chsh
(Change Shell)
Or for just a specific user:
usermod -s /usr/local/bin/bash ksbuild
To change the default setting of all new users, edit the setting in the defaults file:
/etc/default/useradd

Resources