New answers tagged bashrc
Perhaps a more simpler way to accomplish what you need, is to use the -f [filename] option provided in bash and load all the environment variable needed from that alternative rc file. The source buliten (built in function) was not meant to function the way you're using it here. The ". , include, and source bulitens were meant to include library (reusable ...
sh install.sh or bash install.sh to execute your script in a terminal
If you want to program a bash script, then change your shebang (first line of the script file) to #!/bin/bash
The issue turned out to be neither a PATH nor a permissions problem. Anaconda Python was installed in my /root directory, which meant that it could only be accessed by a superuser. Reinstalling Anaconda in home solved the problem.
As @fiximan suggested , I tried to test if tmux session exists or not and then execute some code and finally, with a little tweak I am successful in getting the layout I wanted. Here is what I added to my .bashrc : test -z "$TMUX" && (tmux new-session -d && tmux split-window -h && tmux split-window -v && tmux -2 ...
This looks like it has nothing to do with permissions. You'd see a "permission denied", not a "command not found". What's going on is that you seem to have . in your $PATH as root (which is insane), but not for your own account. Is it safe to add . to my PATH? How come? Answer: no. You unpack a tar.gz, cd into the directory, and run ls. There's an ...
Set the history file to ~root/.bash_history.$SUDO_USER, where $SUDO_USER is automatically set to the user who invoked sudo. For example, the following could go in your root bashrc: HISTFILE="$HOME/.bash_history.$SUDO_USER"
Top 50 recent answers are included