Linked Questions

1
vote
1answer
2k views

How to set a path variable without root acess? [duplicate]

My college currently uses a very old (like 3 years old) openJDK 1.7 distribution. And being a student, obviously I don't have root privileges. I wanted to use a much later version downloaded a much ...
1
vote
0answers
15 views

Best way to set enviroment variables for all processes [duplicate]

What is the best and standard way for setting env vars in Linux so they are visible for all processes (and users) ? Is adding them to /etc/environment the best practice ?
319
votes
5answers
170k views

Difference between Login Shell and Non-Login Shell?

I understand the basic difference between an interactive shell and a non-interactive shell. But what exactly differentiates a login shell from a non-login shell? Can you give examples for uses of a ...
105
votes
4answers
34k views

Is there a “.bashrc” equivalent file read by all shells?

Is ~/.bashrc the only place to specify user specific environment variables, aliases, modifications to PATH variable, etc? I ask because it seems that ~/.bashrc seems to be bash-only, but other ...
38
votes
5answers
36k views

how can I use bash as my login shell when my sysadmin refuses to let me change it

The unix sysadmin where I'm working is reluctant to give me access to change my login shell from ksh to bash. He has given various excuses, the funniest being that since they write all their scripts ...
18
votes
1answer
10k views

What should I set my locale to and what are the implications of doing so?

This question was stimulated by asking the question Chromium browser does not allow setting the default paper size for "Print to File", and also by a conversation with @Gilles on chat. As ...
2
votes
1answer
10k views

Script with curl works manually but not in cron job

My script (status.sh) is: #!/bin/bash SITE=http://www.example.org/ STATUS=$(/usr/bin/curl -s -o /dev/null -I -w "%{http_code}" $SITE) if [ $STATUS -eq 200 ] then echo $STATUS >> /home/myuser/...
10
votes
1answer
2k views

Is there a Bash file that will be always sourced in interactive mode no matter if it is login or non-login?

As far as I know, the interactive shells may be login or not login, and the start up files for them are different. If interactive + login shell → /etc/profile then the first readable of ~/....
4
votes
2answers
3k views

$PATH not modified inside LXDE on Raspbian

I have a bin directory in home/pi. This is added to my $PATH when I login (by .profile), but when I go into LXDE and use LXTerminal my bin directory is no longer added to $PATH.
2
votes
1answer
4k views

Using alias in another script (ksh)

I'm writing a ksh script, and I'd like to use a command define by an alias in my .profile file, in my script. I tried this command in the folder containing my script, and it works. However, in my ...
1
vote
1answer
2k views

Sourcing BASH_ENV for non-interactive SSH commands

I'm hoping to get the $BASH_ENV var to source for non-interactive ssh commands. I do see my BASH_ENV: ssh server.example.com env | grep BASH BASH_ENV=/tmp/set_bash_env_profile If I do simple ssh ...
2
votes
3answers
2k views

get Cron to run in the same environment as I get with ssh login

I've a script that runs fine when I ssh to my ubuntu EC2 instance and run it (as the user ubuntu) I want this to happen when the server boots, so I added it to cron as: @reboot sleep 10 && /...
1
vote
3answers
1k views

Can you set the Environment Variables that each process will have once executed in Linux?

In Windows, you can use the following window to set the Environment Variables that each process will have once executed: Can you do the same thing in Linux?
1
vote
1answer
1k views

Shell command output not being displayed in tmux status

I have the following status-right: set -g status-right "#{prefix_highlight}[wifi:#[fg=brightred]#(wifi_status)#[fg=yellow]|#[fg=brightgreen]#{cpu_icon}#[fg=yellow]:#{cpu_percentage}|#{battery_icon}:#{...
3
votes
2answers
926 views

Convention personal environment variables

Is there an Unix convention for setting personal environment variables? I read they should be put in $HOME/.bash_profile instead of $HOME/.bashrc. Nonetheless, I was thinking of providing a way to ...

15 30 50 per page