# PATH and MODULEPATH changed in form.yml.erb

**URL:** <https://discourse.openondemand.org/t/path-and-modulepath-changed-in-form-yml-erb/1352>\
**Category:** Get Help\
**Created:** [March 8, 2021, 5:49pm UTC](https://discourse.openondemand.org/t/path-and-modulepath-changed-in-form-yml-erb/1352 "2021-03-08T17:49:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eisenefaust](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/eisenefaust/32/470_2.png) [@eisenefaust](https://discourse.openondemand.org/u/eisenefaust)\
**Post date:** [March 8, 2021, 5:49pm UTC](https://discourse.openondemand.org/t/path-and-modulepath-changed-in-form-yml-erb/1352/1 "2021-03-08T17:49:56Z")

</div>

Hello,  
I’m trying to launch a command line tool from within my form.yml.erb. It relies on being on certain modules being loaded/loadable and specific environment variables such as PATH. When I build it in my shell using “erb -T - form.yml.erb” it produces the correct output. When I use it within the OOD sandbox, PATH has been changed and MODULEPATH is no longer defined.

The PATH got changed to this: “/opt/ood/ondemand/root/usr/share/gems/2.5/bin:/opt/rh/rh-nodejs10/root/usr/bin:/opt/rh/rh-ruby25/root/usr/local/bin:/opt/rh/rh-ruby25/root/usr/bin:/opt/rh/httpd24/root/usr/bin:/opt/rh/httpd24/root/usr/sbin:/opt/ood/ondemand/root/usr/bin:/opt/ood/ondemand/root/usr/sbin:/sbin:/bin:/usr/sbin:/usr/bin”

What do you recommend as the correct way to set up my cluster to enable these values to be preserved or to work around this?

If you need any snippets of my files, I’m more than happy to provide them.

Thank you for you help!  
Glenn Morton  
Seattle Children’s Hospital

---

<div class="post-metadata">

**Author:** ![omerzulfiqar](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/omerzulfiqar/32/621_2.png) [@omerzulfiqar](https://discourse.openondemand.org/u/omerzulfiqar)\
**Post date:** [March 10, 2021, 6:23pm UTC](https://discourse.openondemand.org/t/path-and-modulepath-changed-in-form-yml-erb/1352/2 "2021-03-10T18:23:23Z")

</div>

Hi!

Could you please show me the command you’re running in `form.yml.erb`?

So OOD’s environment is not a login shell. You could try wrapping the command in `bash -lc` like

`bash -lc /fullPath/command`

The `bash -l` will create a new environment for the command to be run in, and should help resolve the issue.

---

<div class="post-metadata">

**Author:** ![eisenefaust](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/eisenefaust/32/470_2.png) [@eisenefaust](https://discourse.openondemand.org/u/eisenefaust)\
**Post date:** [March 10, 2021, 7:46pm UTC](https://discourse.openondemand.org/t/path-and-modulepath-changed-in-form-yml-erb/1352/3 "2021-03-10T19:46:20Z")

</div>

> [@omerzulfiqar](#):
>
> bash -lc

That works beautifully! Thank you so much!  
In case you were curious these both worked well for executing the command:

1. `cmd = "bash -lc \"voucher\""`  
``#{cmd}``
2. ``bash -lc "voucher"``

---

<div class="post-metadata">

**Author:** ![westburg.2](https://avatars.discourse-cdn.com/v4/letter/w/0ea827/32.png) [@westburg.2](https://discourse.openondemand.org/u/westburg.2)\
**Post date:** [May 26, 2022, 3:42pm UTC](https://discourse.openondemand.org/t/path-and-modulepath-changed-in-form-yml-erb/1352/4 "2022-05-26T15:42:57Z")

</div>


