# Execute Scripts on Running p4App

**URL:** <https://forum.p4.org/t/execute-scripts-on-running-p4app/613>\
**Category:** Getting Started with P4\
**Created:** [January 22, 2023, 1:05am UTC](https://forum.p4.org/t/execute-scripts-on-running-p4app/613 "2023-01-22T01:05:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![christnp](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@christnp](https://forum.p4.org/u/christnp)\
**Post date:** [January 22, 2023, 1:05am UTC](https://forum.p4.org/t/execute-scripts-on-running-p4app/613/1 "2023-01-22T01:05:21Z")

</div>

Good Evening,

I’d like to have a couple of terminals open and execute scripts on an existing p4App container. This can be either two remote terminals (SSH) or using the `exec` command.

I’ve tried the guidance in the README (e.g., sudo p4app exec m h1 ) which seems to work with build in commands. For example, `sudo p4app exec m h1 ifconfig` shows me the network config for `h1` as expected. However, I am unable to run my custom scripts using this method. For example, `sudo p4app exec m h1 ./recv` returns the error `./recv: No such file or directory`.

Is there a way to achieve my desired environment?

R/

---

<div class="post-metadata">

**Author:** ![tmp](https://avatars.discourse-cdn.com/v4/letter/t/e47774/32.png) [@tmp](https://forum.p4.org/u/tmp)\
**Post date:** [January 25, 2023, 7:34pm UTC](https://forum.p4.org/t/execute-scripts-on-running-p4app/613/2 "2023-01-25T19:34:49Z")

</div>

```auto
pidh1=$(ps aux | grep mininet:h1 | awk '{print $2}')
sudo mnexec -a $pidh1 ./recv

```

---

<div class="post-metadata">

**Author:** ![christnp](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@christnp](https://forum.p4.org/u/christnp)\
**Post date:** [February 1, 2023, 8:54pm UTC](https://forum.p4.org/t/execute-scripts-on-running-p4app/613/3 "2023-02-01T20:54:09Z")

</div>

Thank you, I appreciate the reply. How would I translate this to the p4App? There is the `p4App exec` but it seems to not allow for PID handles.
