# Include libexec directory for script when run

**URL:** <https://community.unix.com/t/include-libexec-directory-for-script-when-run/335946>\
**Category:** Shell Programming and Scripting\
**Created:** [October 27, 2013, 7:01am UTC](https://community.unix.com/t/include-libexec-directory-for-script-when-run/335946 "2013-10-27T07:01:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KevinSjoberg](https://community.unix.com/user_avatar/community.unix.com/kevinsjoberg/32/8925_2.png) [@KevinSjoberg](https://community.unix.com/u/KevinSjoberg)\
**Post date:** [October 27, 2013, 7:01am UTC](https://community.unix.com/t/include-libexec-directory-for-script-when-run/335946/1 "2013-10-27T07:01:36Z")

</div>

Hi everyone!

This is my first post, so bear with me.

I have this script, vpm, which make use of the libexec directory for commands intended to be run by the `bin/vpm` binary. I want to add the libexec directory to $PATH when running the vpm binary. I don't want the script itself to try figure out where the path is, so I want to specify the path during installation.

Currently the binary have this line `export PATH="%VPM_LIBEXECDIR%:$PATH"` . When I install the script I just replace "%VPM\_LIBEXECDIR%" with the actual path.

This works, but it's problematic when I develop locally because then I just want to run the script directly by going to the directory and run `./bin/vpm` .

How does people usually solve this problem?

---

<div class="post-metadata">

**Author:** ![bartus11](https://community.unix.com/user_avatar/community.unix.com/bartus11/32/1418_2.png) [@bartus11](https://community.unix.com/u/bartus11)\
**Post date:** [October 27, 2013, 7:33am UTC](https://community.unix.com/t/include-libexec-directory-for-script-when-run/335946/2 "2013-10-27T07:33:52Z")

</div>

You can run your script like this:

```nohighlight
PATH=/your/libexec/path:$PATH ./bin/vpm

```

---

<div class="post-metadata">

**Author:** ![KevinSjoberg](https://community.unix.com/user_avatar/community.unix.com/kevinsjoberg/32/8925_2.png) [@KevinSjoberg](https://community.unix.com/u/KevinSjoberg)\
**Post date:** [October 27, 2013, 7:57am UTC](https://community.unix.com/t/include-libexec-directory-for-script-when-run/335946/3 "2013-10-27T07:57:38Z")

</div>

But of course, why didn't I think of that! Thank you. I guess the only thing that will be bugging me a bit is the fact that the string "%VPM\_LIBEXECPATH%" is present in $PATH, which is kind of ugly. Then, again, this will only occur when running it directly (no installation).
