3
votes
2answers
55 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 ...
0
votes
0answers
24 views

-bash: android: command not found

I'm on a Mac running Mavericks trying to learn how to develop Android apps (in the process I'm learning bash too). To run on the emulator they suggest the command android avd. I always get the error ...
1
vote
2answers
157 views

Setting PATH vs. exporting PATH in ~/.bash_profile [duplicate]

What's the difference and which is better to use when customizing my bash profile? Documentation on the export command is scarce, as it's a builtin cmd. Excerpt from version 1 of my ~/.bash_profile: ...
1
vote
2answers
60 views

Alias from .bash_profile is not reflected across the system

I have few path settings and alias in .bash_profile, and I am exporting those. For example: alias gcc=/abc/def/......./myrtgcc export gcc And I want use myrtgcc to compile C programs either from ...
1
vote
2answers
33 views

remove files after insertion into tarball

I want to limit the number of files that get put into a tar ball and erease them after they've been inserted into the tarball and being indipendent from the current directory. I've tried this: tar -C ...
4
votes
6answers
198 views

List all binaries from $PATH

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

Bash script to output path to USB flash memory stick

How would I return (output) the path to any USB flash memory stick(s) connected to the local computer using bash (Ubuntu and Linux Mint)? Background: I'm providing users with an automated backup ...
1
vote
1answer
62 views

Program installed to `/home/username/bin` and added to path… not launching [duplicate]

I just installed newer versions of grep and vim to my local ~/bin directory. I have the path added via PATH=$PATH:$HOME/bin in my .bash_profile. When I try to run either, the version installed in ...
5
votes
2answers
89 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
60 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
76 views

Editing the .profile file to access

I am trying to source my .profile file to easily access a directory of javatools. The bash code below seems like it should work but it does not. Any help troubleshooting this script would be very much ...
0
votes
1answer
113 views

Full path name of bash? and base process of Linux?

I am new to Linux and I recently had a test at school which had the following questions: What is the full path name of bash? What is the base process of Linux? I couldn't answer these. Does anyone ...
0
votes
1answer
492 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 ...
1
vote
1answer
75 views

Getting sudo to work for an alias

I installed Sublime Text 3 in Fedora 20 which has got GNOME, as I couldn't get it being called from terminal I created a .bash_aliases file which a line like this: alias sublime='sublime_text' And ...
2
votes
2answers
503 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 ...
1
vote
4answers
309 views

How can I force the use of a specific binary when running a script

How can I force a specific binary to be used when executing a bash script? I have a bash script which uses the "php" binary. There are several php versions on my computer. The main php binary, as ...
2
votes
1answer
306 views

Debian Wheezy 7.1 - can't launch Skype or Firefox [duplicate]

I've installed Skype by using dkpg and when I try to run it, this is what I get -bash: /usr/bin/skype: No such file or directory. Which is very strange since ls -l | grep skype shows this: -rwxr-xr-x ...
10
votes
2answers
630 views

Bash is not finding a program even though it's on my path

I have a program on my path. The program runs when executed with a full path specified. But the program cannot be found when I run it with just its name. Essentially, I want to understand how the ...
2
votes
3answers
980 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 ...
-3
votes
1answer
168 views

Paths in my bash profile do not work!

export PATH=/usr/local/bin:/Users/rodrigoprugue/Desktop/CRUNCH:~/phreeqc/bin:$PATH export PARFLOW_DIR=~/parflow/parflow.r605/ export SILO_DIR=~/parflow/silo-4.7.2/ export ...
2
votes
1answer
193 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 ...
5
votes
1answer
112 views

Correct handling of Python2 and Python3

What is the correct way running scripts that depend on python2.x but on a system where python3.x is aliased with python. The solution should take into account the following things : Python2 ...
8
votes
3answers
413 views

Running an executable in PATH with the same name as an existing function

Sometimes I define a function that shadows an executable and tweaks its arguments or output. So the function has the same name as the executable, and I need a way how to run the executable from the ...
3
votes
4answers
1k views

List all files / binaries in current PATH

Is there an "easy" way of running an "ls -la" style command for listing all files / executable binaries in the current PATH? (I intend to pipe the output into grep, for looking for commands with ...
4
votes
2answers
308 views

Inhibit Variable Expansion in Paths

How do I prevent Zshell (and Bash I assume) from expanding environment variables in paths be completed as shown in the following example: $PREFIX/alt/li should expand to $PREFIX/alt/lib and not ...
7
votes
3answers
779 views

My `which` command may be wrong (sometimes)?

I've compiled the last emacs version from the source code (v24.2) because the version installed on my machine is (quite) old for me (v21.3). I've done the usual: $configure --prefix=$HOME make make ...
6
votes
2answers
2k 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 ...
1
vote
2answers
13k views

How to set environment variable JAVA_HOME that will be saved on exit? [duplicate]

Possible Duplicate: How do I set a user environment variable? (permanently, not session) I use Suse. First was installed jdk7, so JAVA_HOME remains like: /usr/java/jdk1.7.0_05/ After I ...
1
vote
1answer
182 views

How to find/correct error in a path

It's often that a long path is mistyped or you get a log file entry that a path does not exist. Is there a command or shell function that navigates the path hierarchy until it finds a matching path? ...
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
11answers
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 ...
6
votes
4answers
2k views

How does Bash path completion work with sudo?

Tab path completion does not work (at least on Ubuntu and AFAIK Arch) with sudo mount <whatever> The iso file I am trying to mount is not in /etc/fstab. If I just type mount <whatever> ...
2
votes
1answer
2k views

Why my $PATH is not inherited by the invoked bash?

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. Usually I start my session from exec ...
90
votes
4answers
145k views

How to correctly add a path to PATH?

I'm wondering where a new path has to be added to PATH environment variable. I know this is accomplished editing .bash_rc (for example), but it's not clear how to do this. This way: export ...
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 ...
7
votes
2answers
7k views

How to alter PATH within bash script?

I have several projects that require me to change versions of Java/Grails/Maven. I'm trying to handle this with some Bash scripts that would make the changes. For example: #!/bin/sh export ...
2
votes
0answers
113 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 ...
8
votes
1answer
1k 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. ...
9
votes
5answers
2k 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 ...
3
votes
7answers
249 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 ...
18
votes
3answers
6k 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
5k 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:
7
votes
5answers
7k 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 ...
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 ...
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 ...