All Questions
261
questions
5
votes
2
answers
9k
views
How to fix bash looking for a program in the wrong dir (Issues setting up NPM on Ubuntu 11.10)
This time I ran the "trusting" install script curl http://npmjs.org/install.sh | sudo sh from the dir /.
$ which npm
/usr/local/bin/npm
$ npm
bash: /home/steven/local/bin/npm: No such file or ...
2
votes
0
answers
133
views
Why is my PATH not listed in my .bashrc file? [duplicate]
Possible Duplicate:
Is it possible to find out which files are setting/adding to environment variables, and their order of precedence?
I am a Linux novice. I would like to edit my PATH (which I ...
10
votes
1
answer
5k
views
Where have I set my bash PATH?
I want to remove ~/bin from my PATH. I set it up months ago when Linux (Ubuntu) was very new to me, but I don't know how I added it...
Nothing shows up when I search all the files listed below.
...
56
votes
7
answers
48k
views
Refer to a file under the same directory of a script found in $PATH
I have a bash script file, which is put under some directory added to $PATH so that I can call the script from any directory.
There is another text file under the same directory as the script. I ...
4
votes
8
answers
302
views
"which" with a little "grep"-like solution?
# which mkdir
/bin/mkdir
# which mkdi
#
How can I get the path of the e.g.: mkdir's binary without knowing the name of the binary file? (command). So that which mkdi would output the /bin/mkdir too.
80
votes
6
answers
50k
views
Duplicate entries in $PATH a problem?
I source the bashrc's of a few of my friends. So I end up having duplicate entries in my $PATH variable. I am not sure if that is causing commands to take a really long time to start. How does $PATH ...
16
votes
3
answers
52k
views
Multiple path environment variable setup lines with bash
I have very long export PATH=A:B:C .... Can I make a multiple lines to have more organized one as follows?
export PATH = A:
B:
C:
11
votes
5
answers
17k
views
Find absolute path from a script
In a script I get in $0 the possible relative path to it. For converting it to absolute I've found this solution which I don't understand:
abspath=$(cd ${0%/*} && echo $PWD/${0##*/})
My ...
2
votes
3
answers
3k
views
Bash: why isn't "set" behaving like I expect it to?
I have observed that only the values of exported variables are appended to the my PATH variable via my Mac OS X .bash_profile. Whereas, the values of locally set variables cannot. Why can't local ...
18
votes
5
answers
10k
views
Find a file in the path without "which"?
I am (somehow) able to run a script:
$ assemble.sh file
... [output]
But which can't find it:
$ which assemble.sh
which: no assemble.sh in (/s/std/bin:/usr/afsws/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/...
25
votes
4
answers
15k
views
Share aliases and PATH setting between zsh and bash
The shell that I normally use is zsh. I have several aliases to enable color in some programs such as ls and grep. I've also set my custom path so that I can execute programs in non-standard place (...