# Bash Node: Command not found

**URL:** <https://forum.knime.com/t/bash-node-command-not-found/46256>\
**Category:** KNIME Extensions\
**Tags:** bug\
**Created:** [August 23, 2022, 12:51pm UTC](https://forum.knime.com/t/bash-node-command-not-found/46256 "2022-08-23T12:51:10Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![mwiegand](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mwiegand/32/66896_2.png) [@mwiegand](https://forum.knime.com/u/mwiegand)\
**Post date:** [October 18, 2022, 3:03pm UTC](https://forum.knime.com/t/bash-node-command-not-found/46256/17 "2022-10-18T15:03:56Z")

</div>

Just for completeness, I rebooted but it did not have any effect. I tried setting the PATH variable in Knime but it failed with `Execute failed: Cannot execute command` as well.

I think the only two options left at present are to:

1. Create a shell script, which could get done via Knime, and make it executable OR
2. Using Java to make bash calls like in [Shell Command in knime](https://forum.knime.com/t/shell-command-in-knime/6709)

While attempting the two options I encountered an issue with approach #1. I can’t make the shell script executable. Setting POSIX permission fails.

 ![Bildschirmfoto 2022-10-18 um 15.31.01](https://forum-cdn.knime.com/uploads/default/original/3X/5/9/5988d31b4d621061255945fe3c79a31ebcc2d3d0.jpeg)

![Bildschirmfoto 2022-10-18 um 15.32.16](https://forum-cdn.knime.com/uploads/default/original/3X/1/3/133952816629238f6057e519ae686d379d5e3c94.jpeg)

With approach #2 I noticed a possible cause of the command not found. Using the Bash Node to get all env variables it gave back a PATH variable. However, using the Java Snipped the PATH variable was not found. Could it be that the PATH variable is not properly setup / defined and Knime respectively Eclipse falls back to a default?

 ![Bildschirmfoto 2022-10-18 um 16.56.56](https://forum-cdn.knime.com/uploads/default/original/3X/7/7/7719b4de569f819b455607676c0aeeca15fe1c32.jpeg)

I put all bits and pieces in this workflow together:

NOTE: There is a mistake with the Java Snippet which I noticed only after upload. Will update the workflow once resolved.

> **[Bash Command not Found – mwiegand](https://hub.knime.com/mwiegand/spaces/Public/latest/Bugs/Bash%20Command%20not%20Found~aaUO_QNxyPnArESP)**
>
> Solutions for data science: find workflows, nodes and components, and collaborate in spaces.

There are a few additional interesting findings as well. Using the `whereis YOUR-CMD` command to locate the executable the commands which do NOT work still could be found. The `where YOUR-CMD` (without “is”) command also works in the terminal but not in Knime.

**where and whereis CMD in Terminal**  
 ![Bildschirmfoto 2022-10-18 um 17.02.20](https://forum-cdn.knime.com/uploads/default/original/3X/f/3/f31cb7e7aabc805c50db7665621d2c11d59f9784.jpeg)

**where and whereis CMD in Knime**

 ![Bildschirmfoto 2022-10-18 um 17.03.08](https://forum-cdn.knime.com/uploads/default/original/3X/9/6/96b291b5fb9ab24a7ddcf8d6ce2dca27293cafd9.jpeg)

Since not everyone uses OS X, even though it’s linux, in case anyone wants to debug something, we could arrange a remote debugging session.

Best  
Mike

---

_[View the full topic](https://forum.knime.com/t/bash-node-command-not-found/46256)._
