tags:

views:

114

answers:

3

I do not have su access and I have a perl executable in ~/et directory which is called exiftool.

I need to add that executable to bash commands (so that I can type exiftool instead of ~/et/exiftool).

The problem is that ~/et contains other files that are not executable (so I cannot use export PATH=$PATH:$HOME/et). Is there any alternative?

+8  A: 

You could use an alias:

alias exiftool=~/et/exiftool

Or you can symlink it elsewhere and add that directory to your path:

mkdir -p ~/bin
ln -s ~/et/exiftool ~/bin
PATH=$HOME/bin:$PATH
bdonlan
Any method that uses `PATH` is preferable, be it symlinking as described or installing executables into a `bin` directory.
Jefromi
Why symlink? just move the file into ~/bin
William Pursell
I'm assuming there's some reason for it to be in ~/et
bdonlan
PATH=$HOME/bin:$PATH does search in bin before default path? Or vice versa?
collimarco
Anathor question: is it normal that when I type "README" I get -bash: /home/collimarco/et/README: Permission denied ?
collimarco
@collimarco, that searches $HOME/bin first. And, if you are ~/et to your path and it has a non-executable README, you might well get such errors.
bdonlan
Just don't make a text file in /home/collimarco/et/ and call it ls or something :)
Eugene
@bdonlan $ cd ~$ README-bash: /home/collimarco/et/README: Permission denied@Eugene There are a lot of files and some of the can not be moved because they are part of the application
collimarco
+1  A: 

I don't understand why having files that are not executable in the directory prevents you from adding the directory to your PATH anyway?

As an alternative, though, you can use an alias.

alias exiftool=$HOME/et/exiftool

You can place this in your .bashrc to have it always available.

Charles Bailey
+1 for the "don't understand" part.
balpha
A: 
  1. softlink to a folder in PATH
  2. alias exiftool='~/et/exiftool'