0
votes
1answer
44 views

$PATH environment variable does not seem to be recognized

I've made a fresh install of Debian Wheezy, and installed zsh to it. Few days after, I've done a vanilla installation of TeX Live 2014, so I added the necessary binary paths to my $PATH. Now I started ...
0
votes
1answer
45 views

`command` vs `type` - Locate program file in user's PATH [duplicate]

I need locate program file in user's PATH. I found few solution, the best are command and type. Which is better, faster, UNIX-like way and why? command -v <application> type -p ...
-1
votes
1answer
35 views

bash: adduser: command not found on centOS

I installed centos 5.5 on my vmware 8 recently and i am trying to add a new user on the system. I am unable to add the user unless i use su - option. I believe it has to do something with path not set ...
0
votes
1answer
18 views

paths for searching executables [duplicate]

My old xournal is 0.4.5, which is /usr/bin/xournal. I just installed a new version 0.4.8 by compiling from source to /usr/local/bin/xournal. When I call xournal directly from the terminal, it is the ...
4
votes
1answer
159 views

Keep getting the same result after “export PATH”

I am doing this: $ which cabal /usr/bin/cabal $ export PATH=$PATH:$HOME/.cabal/bin $ which cabal /usr/bin/cabal I expect to get /.cabal/bin/cabal for $ which cabal (this path exists) after this. ...
3
votes
2answers
130 views

Getting the current path in .desktop EXEC command

Im trying to make a .desktop file run a .sh which is stored in the same directory as the .desktop. The whole directory needs to be portable and moved from machine to machine. my run script is run.sh ...
4
votes
1answer
45 views

How to update 'command cache' after change of soft links?

I have changed multiple soft links on my system with ln -f -s. When I view the link with ls -l, I see they point to the right target. However, when I try to run the command, it still tries to use the ...
0
votes
1answer
91 views

Why $PATH variable different between two directories?

When I'm in one directory and echo path pwd /Users/me/src/some_proj echo $PATH /Users/me/.gem/ruby/2.0.0/bin:/opt/boxen/chruby/versions/2.0.0- ...
2
votes
2answers
204 views

Select default binary to use

This is the output from which -a autoconf: /usr/bin/autoconf /usr/bin/autoconf /home/amumu/root/bin/autoconf I want to use autoconf in my home directory since it's newer version compare to the ...
12
votes
1answer
297 views

Percent in $PATH environment variable

My $PATH looks like this: ...
18
votes
4answers
810 views

Path independent shebangs

I have a script that I want to be able to run in two machines. These two machines get copies of the script from the same git repository. The script needs to run with the right interpreter (e.g. zsh). ...
10
votes
6answers
625 views

How can I cleanly add to $PATH?

I'd like a way to add things to $PATH, system-wide or for an individual user, without potentially adding the same path multiple times. One reason to want to do this is so that additions can be made ...
4
votes
3answers
190 views

What's the right way to set “dynamic” PATH in bash? (for android sdk)

I have android sdk installed, and I want the binaries in build-tools/android-VERSION to be available in PATH, so I add few lines: ...
4
votes
6answers
248 views

List all binaries from $PATH

Is there one-liner that will list all executables from $PATH in bash.
5
votes
2answers
99 views

Default preference of executable over built-ins with the same name

I was playing around a bit with the names of some executables, putting them in a folder, ~/bin, which is in my $PATH. Now I'm wondering how I can set the preferences of a bash-3.2 terminal so that it ...
1
vote
2answers
68 views

Make Trickle get the correct $PATH

Trickle is a bandwidth limiting program. I have the following script for trickle. #!/bin/bash echo $PATH trickle -s -t 3 -u 200 -d 200 "$@" I have a script in ~/bin/ that want to run the script ...
1
vote
1answer
776 views

Meaning of `export PATH=…` in .bash_profile

I'm using a mac for some years now and as I'm currently learning ruby on rails, I felt like I should learn more about the system I'm using. I took a look at the ~/.bash_profile, it looks like this ...
2
votes
2answers
1k views

Removing a directory from PATH

I'm trying to compile wxWidgets using MingW, and I have cygwin in my path, which seems to conflict. So I would like to remove /d/Programme/cygwin/bin from the PATH variable and I wonder if there is ...
3
votes
1answer
889 views

Find location of sourced shell script

Is it possible that a sourced shell script knows its location? I've read determining path to sourced shell script but the answers focus on bash and tcsh and fail if a POSIX shell is used. $0 is also ...
19
votes
3answers
812 views

Show PATH in a human-readable way

I want to show my PATH environment variable in a more human-readable way. $ echo $PATH ...
2
votes
3answers
1k views

Why do 'ssh host echo $PATH' and printing the $PATH after ssh'ing into the machine give different results?

On a particular host, when I ssh into the machine and enter echo $PATH I get /home/wxy/bin64:/home/wxy/bin:/usr/kerberos/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin and if I ...
2
votes
4answers
112 views

$PATH duplication issues

If I do echo $PATH I get the following: ...
2
votes
1answer
207 views

Find out where $PATH got corrupted

I'm using OSX Mountain Lion 10.8.2 $echo $PATH prints this: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/myusername/.rvm/bin I've commented out everything in ~/.bash_profile ...
8
votes
4answers
287 views

Why does the “which” command give duplicate results?

which -a ruby gives me /usr/ruby /usr/ruby /usr/ruby It gives the same path three times. Why does this happen?
4
votes
3answers
2k views

Add directory to path for all shells and users in SLES 11.1

I'm using a server running Suse Enterprise 11.1. I need to add some locations to the path for all users and for all the shells. Is there a nice and easy way to do this or do I have to modify the ...
1
vote
1answer
409 views

Can I get correct $PATH when executing sudo -u db2inst -sh “db2”?

I need to run sudo -u db2inst1 sh -c "db2 connect to db; db2 set schema Edumate; db2 \"select * from edumate_settings\"" but I don't want to specify absolute path to db2 If I run sudo -u db2inst1 sh ...
6
votes
2answers
3k views

Why Bash unable to find command even if $PATH is specified properly?

I am specifying path to my command in the file /etc/profile: export PATH=$PATH:/usr/app/cpn/bin My command is located in: $ which ydisplay /usr/app/cpn/bin/ydisplay So, when I performing "echo ...
3
votes
2answers
231 views

open a file using CDPATH and symlink

To quickly move around, I added a path to CDPATH that contains symlinks to different locations. I did this by adding the following line to .bashrc: export CDPATH=~/symlinks When working with ...
3
votes
3answers
170 views

Exporting just a single file

To make scripts accessible from anywhere in the terminal, one can use the following sequence of commands: PATH=$PATH:some_path_here export PATH Which includes all files at the path sent in ...
19
votes
12answers
3k views

Remove duplicate $PATH entries with awk command

I am trying to write a bash shell function that will allow me to remove duplicate copies of directories from my path environment. I was told that it is possible to achieve this with a one line ...
3
votes
2answers
192 views

Finding program name by wildcard pattern

I am trying to write a script that will attempt to find if a certain program is installed. Lets say that the program is called, myprog. The problem is that the program can be named in different ...
2
votes
2answers
2k 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 ...
3
votes
7answers
250 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 ...
4
votes
2answers
646 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 ...
6
votes
3answers
3k 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 ...
8
votes
5answers
3k 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 ...
14
votes
4answers
820 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 ...
13
votes
3answers
2k 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 ...
5
votes
2answers
537 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 ...