2

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?

1
  • 1
    Actually you can add ~/et to your PATH even if there are non-executable files in there. Bash is smart enough to not execute them. Commented Aug 5, 2009 at 16:55

3 Answers 3

8

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
Sign up to request clarification or add additional context in comments.

8 Comments

Any method that uses PATH is preferable, be it symlinking as described or installing executables into a bin directory.
Why symlink? just move the file into ~/bin
I'm assuming there's some reason for it to be in ~/et
PATH=$HOME/bin:$PATH does search in bin before default path? Or vice versa?
Just don't make a text file in /home/collimarco/et/ and call it ls or something :)
|
1

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.

Comments

0
  1. softlink to a folder in PATH
  2. alias exiftool='~/et/exiftool'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.