1
vote
3answers
33 views

How do I prevent $PATH from resetting itself each time?

I'm having difficulty setting up the PATH on my macbook pro. I followed this link to modify my path variable. Each time I start a new terminal I get a PATH pointing towards ...
1
vote
1answer
66 views

Where to store bash scripts that all users may execute on Debian?

I have many bash scripts on my server, that all users may use. but it seems the location /usr/local/sbin is not the best place. I don't want to use the home directory of the users, cause ...
0
votes
2answers
42 views

how do I add /usr/local/sbin to the PATH of a user? [duplicate]

if I type echo $PATH I only get /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games how can I add /usr/local/sbin to the path, so it is already there the next time? (I use debian ...
0
votes
1answer
30 views

Executable not found although in PATH

My $PATH is set to a lot of directories including ~/bin and ~/target/bin I want to execute script.sh which is in ~/target/bin but I get the error bash: ~/bin/script.sh: No such file or directory ...
0
votes
0answers
40 views

which program is really running?

I am running a self-compiled version on python2.7, --prefix=$HOME, so as not to interfere with the standard installation of python2.6 (on Ubuntu 10.04). Had some problem importing the ssl modules, ...
0
votes
2answers
29 views

How to make scripts run from anywhere on OS X?

I've correctly added my scripts folder to my $PATH. But I still cannot run the scripts from anywhere by simply calling them. How do I achieve this? Example. If I have ~/scripts/ in my path and in ...
2
votes
1answer
89 views

Can only use some commands as sudo

I have had a bit of a problem with some commands lately, not working as intended. I wanted to fiddle with some Markdown and try it as a substitute for some simple HTML pages, so I looked into some ...
0
votes
1answer
83 views

How to permanently reset my $PATH?

I was trying to add something to $PATH and it went totally wrong. I now can't run any commands such as ls. I've looked at this answer ...
0
votes
0answers
209 views

Faking a Linux environment without chroot

For a university project I want to test a C++11 program on a 32-core machine. Unfortunately the machine has Ubuntu 12.04 with GCC 4.6 installed (we need GCC 4.7 because of some C++11 threading ...
0
votes
2answers
81 views

How to get ~/foo from /home/user1/foo?

The Bash prompt supports the \w escape sequence, documented as \w the current working directory, with $HOME abbreviated with a tilde (uses the value of the PROMPT_DIRTRIM variable) Is ...
0
votes
2answers
161 views

Unix list absolute file name

Given an arbitrary single argument representing a file (or directory, device, etc), how do I get the absolute path of the argument? I've seen many answers to this question involving ...
0
votes
1answer
101 views

Mac OS X 10.6 executable not found without full path

I just installed Apache via MacPorts. It seems that my Mac was absolutely confused about which version of the Apache executables to run. After moving the Apache executables that ship with the Mac to ...
0
votes
1answer
99 views

x-terminal-emulator not getting path

I have a script that uses x-terminal-emulator to launch a different script in a new terminal window. I am using ubuntu 12.04 and a colleague of mine is using ubuntu 12.10 and this is not working for ...
0
votes
0answers
15 views

Where is my $PATH declaration in OSX Snow Leopard? [duplicate]

Possible Duplicate: Where does $PATH get set in OS X 10.6 Snow Leopard? When I run echo $PATH in Terminal this is the result: house@The-iMac:~$ echo $PATH ...
0
votes
1answer
208 views

command not found even though directory is in $PATH [closed]

I'm having trouble running a program which should be on my $path, but apparently isn't. When I run it with the full path, it works fine, but when I only call the executable, it says command not found. ...
2
votes
1answer
493 views

Messed up $PATH variable in Mac OS X

I did something to my PATH. I was trying to add some new path and now none of the command like open ~/.bash_profile work, and echo $PATH only shows one path which is /Application/Filename. Is ...
1
vote
1answer
32 views

Why is which not matching the effect I get?

I cannot explain the following behavior: [centos4x64 ~] /usr/local/bin/gmake --version GNU Make 3.82 Built for x86_64-unknown-linux-gnu Copyright (C) 2010 Free Software Foundation, Inc. License ...
2
votes
2answers
186 views

How do I find out where paths in my $PATH were defined?

There are some paths in $PATH, which I don't want. I'm not sure how they got there; they aren't coming from my .profile. Is there a way to determine which scripts are modifying $PATH?
0
votes
1answer
363 views

need help cleaning out my Path Variable in Mac

when I typed $PATH i noticed a jungle -bash: ...
0
votes
2answers
175 views

separate file and path in bash?

How can I separate the path and file elements in a bash loop like this? for file in `find /my/path -name "*.ext"` do #(path,onlyfile) = separate_path_and_file $file #dosomethingwith $onlyfile ...
0
votes
2answers
876 views

Can't access Terminal anymore, only shows a cursor

I run OS X. Following these directions (Installing MySQL on Mac OS X) I added a file to /usr and the contents were PATH=/usr/local/mysql/bin:$PATH Actually I was trying to get the mysql command ...
2
votes
2answers
201 views

Getting “export PATH” to stick

I just upgraded to Lion and I am using bash for the first time (my previous experience is with csh and tcsh). I have encountered unexpected behavior. A simple example is: I create a file ...
0
votes
1answer
606 views

brew doctor giving error on a directory that has been removed

I just installed homebrew and as suggested, I ran the brew doctor command. I am linux newbie and do not know how to fix most of these things. But I would like to ask especially about the following ...
1
vote
1answer
113 views

Get part of script run directory in bash

I'm running a Bash script that's buried in a directory on my system. I need to be able to get the first section of the directory path. The path returned by $0 in my script is as below. The ...
0
votes
1answer
304 views

How do I execute my script by just typing its name?

I have a script in /home/username/scripts and I would like to execute it by just typing its name. I know I could do 'export PATH=$PATH:/home/username/scripts' but I would like to have the same ...
2
votes
3answers
687 views

how to remove path of my command line?

When I start to enter in different folder the path is registered in my command line and I don't know how to remove it. I am almost sure my question wasn't clear. An example is always better. Once in ...
7
votes
2answers
8k views

Environment variables in bash_profile or bashrc?

I have found this question [blog]: Difference between .bashrc and .bash_profile very useful but after seeing the most voted answer (very good by the way) I have further questions. Towards the end of ...
0
votes
4answers
641 views

Can't add executable file to PATH in Linux

I have this in my ~/.bash_profile: PATH=$PATH:~/Downloads/sublimetext export PATH But sublimetext in the folder isn't added to the path. Sublime Text gives this output when submitted to the ...
2
votes
1answer
592 views

How can I find out where an environment variable (like PATH) was set?

I have a xterm with the bash shell in linux. When I echo $PATH, it is showing a directory and I want to know who put this directory in the PATH. How can I find out? Thanks!
3
votes
1answer
992 views

export PATH= not holding in Bash OS X

This is somewhat of a noob question but I'm having problems adding to my path and can't remember how I got changes working the last time I did it. So I'm using the command "export ...
1
vote
1answer
137 views

How do I create a command to run with sudo?

I have created a file called svrestart in /home/gab/bin (which is a folder that should be automatically be added to path on startup) which contains: /etc/init.d/nginx restart /etc/init.d/php5-fpm ...
1
vote
0answers
129 views

Why my $PATH is not inhereted by the invocked bash? [closed]

I work on an AIX system where I have no administrator privileges. It has several shells installed, default being tcsh. I am not allowed to change the login shell. Usualy I start my session from exec ...
7
votes
1answer
10k views

How to permanently add current directory to PATH in Linux? [duplicate]

Possible Duplicate: Add folder to PATH I want to a add a directory to my bash to search in, and I am using the $PATH=.... it works however when I open a new command window it is not there. ...
3
votes
1answer
132 views

Why does ~username/ change to /home/username if tab-completing a path with a space in it?

In ~jacksonc/temp/ there are two files, test.txt and space test.txt, both placed there through Windows (using Samba). Using bash, if I type cat ~jacksonc/temp/t[tab] , it autocompletes to cat ...
0
votes
2answers
614 views

how did git add itself to the PATH on OSX 10.6 ? It's not in bashrc or profile? [duplicate]

Possible Duplicate: How do I set PATH and other environment variables? I recently installed git 1.7.4.4 via the installer from here http://code.google.com/p/git-osx-installer/ (not via ...
2
votes
1answer
569 views

Bash autocomplete paths “through” environmental variables

I used to be able to type cd $home/p hit the tab key and the command would change to cd /home/phill Now it doesn't. When cd'ing to a directory based on an environmental variable, I'm "flying ...
1
vote
1answer
1k views

Adjusting $PATH in /etc/profile does not affect root

H I added a directory to the $PATH variable in /etc/profile. This works for my user account but not for root. It's easy to add it to my /root/.bashrc but I would like to understand whats's wrong. ...
3
votes
3answers
1k views

Add folder to PATH

How to add something to PATH ? I have added like PATH=$PATH:/home/example export PATH and it works until I restart , after that when I type env in PATH there is no /home/example.
0
votes
1answer
234 views

How can I make bash convert '~'?

Some programs do not recognize tilde shortcut in filenames and expect full canonical paths, e.g. /home/dave/myfile.txt instead of ~/myfile.txt. Is there a way to make bash replace ~ and ~user by ...
2
votes
5answers
10k views

How can I display the absolute path in bash prompt?

I currently have my bash PS1 set to something like this: PS1="\[\`if [[ \$? = "0" ]]; then echo '\e[32m\h\e[0m'; else echo '\e[31m\h\e[0m' ; fi\`:\w\n\$ " How can I make it show the absolute path ...
0
votes
1answer
963 views

How to add the current dir to Bash's path and why is it considered a bad idea by some people?

I'd like to add the current dir to the path so i don't have to keep typing stuff like ./a.out over and over. I also recall someone saying it was a bad idea, but don't remember why. I Windows and DOS ...
3
votes
1answer
511 views

Problems with bash path when using 'su'

In Ubuntu Lucid Lynx, I'm trying to do su -l user -c "foo.sh args" where foo.sh is an executable bash script on the PATH set in ~user/.bashrc. Unfortunately, this fails because it can't find ...
1
vote
1answer
181 views

Why PATH variable is different between 'launching from command line' and 'click the icon' in Mac OS X?

As I asked in here, I learned that the environment variable of PATH is different depending on how I launch the app. Using 'aquamacs' from command line is run on top of bash, so the PATH variable is ...
4
votes
3answers
860 views

Which setup files should be used for setting up environment variables with bash?

As I asked and got answers in here, and here, the PATH variable has different path names depending on how the app is activated. Which setup files (.bashrc, .profile, ...) should be used to have the ...
3
votes
3answers
1k views

Why is . not in the path by default?

On UNIX-like systems over the years (most relevantly to me, Linux), I've noticed that . (current dir) is never in the $PATH by default. Why is this? I recall reading years ago that it was a security ...
5
votes
3answers
1k views

How do I permanently set my bashrc changes?

Everytime I log into SSH, I have to manually source the bashrc file to set my path variables the way I want to. How do I have bash do it automatically? Shouldn't it be automatic?
6
votes
2answers
3k views

Avoid unwanted path in Zip file

I'm making a shell script to package some files. I'm zipping a directory like this: zip -r /Users/me/development/something/out.zip /Users/me/development/something/folder/ The problem is that the ...
88
votes
9answers
84k views

Where does $PATH get set in OS X 10.6 Snow Leopard?

I type echo $PATH on the command line and get ...
6
votes
3answers
772 views

Linux: How do I execute a script in a way that it knows its directory?

I need to write a script, which would be called from any location, but needs to run from the directory it resides in. The script should query its directory at runtime. How can this be achieved? ...
30
votes
9answers
10k views

Add directory to $PATH if it's not already there

Has anybody written a bash function to add a directory to $PATH only if it's not already there? I typically add to PATH using something like: export PATH=/usr/local/mysql/bin:$PATH If I construct ...

1 2