New answers tagged

1

You can do multiple path export, In single line, export PATH=${PATH}:/first/path:/second/path:/third/path Multiple paths as export PATH="A" export PATH="B:$PATH" export PATH="C:$PATH"


1

One option is to just add the line, so that you have tow lines changing the path: export PATH="/home/username/anaconda/bin:$PATH" export PATH="/usr/local/share/rsi/idl/bin:$PATH" The other option is to just change the existing line to this: export PATH="/home/username/anaconda/bin:/usr/local/share/rsi/idl/bin:$PATH"


2

This should be it (all paths wanted in ${PATH} seperated by colons) : export PATH="/usr/local/share/rsi/idl/bin:/home/username/anaconda/bin:$PATH"


2

It may be that somehow the BASH-shell-option interactive_comments was disabled. You can replicate the behavior with: ~ $ shopt -u interactive_comments ~ $ # # command not found ~ $ You can determine if it's on or off : $ shopt interactive_comments If the output is "on", then this is not the source of your problem. If it is "off", then you should grep ...


2

That error means that you have an escaped # (this means \#) in one of bash's initialization files. Since it doesn't seem to be in ~/.bashrc or ~/.bash_profile, it has to be in one of the other files bash reads when it is loaded. To be sure, just search through all of them1: grep -FH '\#' ~/.bashrc ~/.profile ~/.bash_profile ~/bash.login \ ...


5

You could add a subshell to your alias. alias composer='php $(pwd)/composer.phar'


3

I would use a shell function: composer() { php "$PWD"/composer.phar "$@" }


22

This is a question that I was going to post here a few weeks ago. Like terdon, I understood that a .bashrc is only sourced for interactive Bash shells so there should be no need for .bashrc to check if it is running in an interactive shell. Confusingly, all the distributions I use (Ubuntu, RHEL and Cygwin) had some type of check (testing $- or $PS1) to ...


4

By convention, .bashrc is place where user store the customize configuration for the shell. These customize configuration can be environment variables, aliases, fancy prompt. With a non-interactive shell, those short of things are meaningless. Moreover, a non-interactive shell can be call in many contexts, you're not sure those environment variables can ...


12

The man page neglects to mention that bash also sources .bashrc for non-interactive remote shells, as in ssh hostname command http://git.savannah.gnu.org/cgit/bash.git/tree/shell.c#n1010 COMMAND EXECUTE BASHRC -------------------------------- bash -c foo NO bash foo NO foo NO rsh machine ls YES (for rsh, ...


2

Bash (and in fact all shells) will execute the first executable file found of the name given searching in the order defined by the $PATH in the environment. Or simply: The first executable found in the $PATH order.


5

Your $PATH is searched sequentially. For example if echo $PATH shows /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin, each of those directories is searched in sequence for a given command (assuming the command isn't an alias or a shell builtin). If you want to override specific binaries on a per-user basis (or you just don't have access to ...



Top 50 recent answers are included