An environment variable on Unix-like operating systems, DOS, OS/2, and Microsoft Windows, specifying a set of directories where executable programs are located
3
votes
7answers
238 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 ...
1
vote
1answer
1k views
Help with installation of ROOT, PATH variable is getting deleted
I am trying to install ROOT which I need for work. I run Ubuntu 10.04 64 bit on virtualbox on my laptop. After extracting the tarball, I try to source the .sh file using the command as suggested in ...
3
votes
2answers
653 views
Problem with $PATH and executable file
I am a complete unix noob so please forgive my simple question. I have a unix executable file located in a directory I generated. I believe I need to get this directory in my $PATH so that the unix ...
2
votes
2answers
173 views
Software (SciTe) runs differently when opened from Terminal Vs GUI
When I open SciTe from the terminal everything works fine. When I open it via Ubuntu 10.04 GUI drop down boxes I get this error every time I try to run a ruby program: sh: ruby: not found At this ...
15
votes
3answers
3k views
Duplicate entries in $PATH a problem?
I source bashrc's of few of my friends. So I end up having duplicate entries in my $PATH variable. I am not sure if that is the problem for commands taking long to start. How does $PATH internally ...
2
votes
2answers
2k 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:
4
votes
2answers
368 views
What does '//' mean in return from `which`
I have an executable script test under the full path /home/sawa/foo/bar/test. The directory /home/sawa/foo/bar is within $PATH, and has priority over the default ones including /usr/bin. When I do
...
0
votes
1answer
215 views
Execute a command in a different path
When using Git VCS, I execute all of the git commands on the directory that contains a .git repository. I want to execute a git-pull through an SSH trigger but how do I define the path to the ...
17
votes
5answers
455 views
shebang and path
Why does a shebang need a path?
Wrong
#!ruby
Correct
#!/usr/local/bin/ruby
#!/usr/bin/env ruby
The operating system should have the information regarding the path for a registered command, and ...
6
votes
2answers
355 views
Which is the best practice when replacing a system binary?
I'm working on Mac OS X which is shipped with several binaries mostly located in /usr/bin/ and /usr/sbin/. Since it doesn't have a native package manager like some Linux distros, I got used to ...
1
vote
2answers
3k views
Adding directory to PATH through Makefile
I'm having some trouble in exporting the PATH I've modified inside the Makefile into the current Terminal. I'm trying to add to the PATH, the bin folder inside wherever the Makefile directory is.
...
2
votes
1answer
470 views
Find the DVD-ROM path in FreeBSD
I do not know the path of my DVD-ROM and also my external hard drive to mount them in FreeBSD using the mount command.
What command should I use to find their path?
2
votes
5answers
690 views
Unix install best practices, append to path or link through
I have some software I am about to ship (gradschool project) and I want to know on a unix machine what the best practices are for installing software.
I originally linked through /usr/local/bin my ...
5
votes
3answers
2k views
How to run a script from another path, and know the script's path?
I need to run a script that access a file in the same path it is located.
For example: I have the script in /home/me/folder/script.sh, and this script will access the file /home/me/folder/myfile. As ...
2
votes
2answers
258 views
What could cause which to not show something in the path?
There is an executable in my path that I believe is a perl script.
>$scriptname
$outputofscript
but
>which $scriptname
which: 0652-141 There is no $scriptname in $path
and the path it ...
9
votes
4answers
229 views
`which`, but all
I think most are familiar with the which command, and I use it frequently. I just ran into a situation where I'm curious not just which command is first in my path, but how many and where all the ...
5
votes
5answers
4k 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 ...
5
votes
4answers
1k 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 ...
2
votes
1answer
608 views
ps command not giving output in home directory
I am logging into a solaris server, switching to bash, then switching to another user "sruser" and switching to bash.
/home/batch/sruser/ is the home directory of the user "sruser".
The issue is ps ...
0
votes
2answers
891 views
installed java, but java -version not showing new java
I just installed jdk1.6.0. I have tried multiple ways to set the path variable and make java 1.6 my new running version. And nothing is working. Running centos5 virtual machine.
alternatives --config ...
10
votes
4answers
541 views
keep duplicates out of $PATH on source
I have the following code that's source-d by my .shellrc
PATH="${PATH}:${HOME}/perl5/bin"
PATH="${PATH}:${HOME}/.bin"
export PATH
but if I make changes to other code and then source this file, my ...
12
votes
3answers
1k 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 ...
2
votes
1answer
754 views
temporary setting the path in an “init” file
I have an "init" file that reads
#!/bin/sh
export PATH=$PATH:/home/me/morph_numsys/software/bin
by which I'd just like to set the path to that folder for only this bash session. However, when I ...
4
votes
2answers
262 views
modify path globally
Is there a standard for $PATH and the order of things that are supposed to be in there? out of the box Arch Linux doesn't have /usr/local/bin in the $PATH. I want to add it but I'm not sure if there's ...