# Return values from terminal

**URL:** <https://discourse.nodered.org/t/return-values-from-terminal/10864>\
**Category:** General\
**Created:** [6 May 2019 20:48 UTC](https://discourse.nodered.org/t/return-values-from-terminal/10864 "2019-05-06T20:48:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike67](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mike67](https://discourse.nodered.org/u/mike67)\
**Post date:** [6 May 2019 20:48 UTC](https://discourse.nodered.org/t/return-values-from-terminal/10864/1 "2019-05-06T20:48:46Z")

</div>

Hello  
When I use the terminal to create a such command 🙂  
`ngrok http https://127.0.0.1:8081`, wich is a command to create a tunnelto expose a port of my machine to the web, with ngrok, then the terminal is cleared and some datas are displayed dynamycally, like this 🙂

```auto
ngrok by @inconshreveable (Ctrl+C to quit)
                                                                                
Session Status online                                            
Account mike (Plan: Free)                                 
Version 2.3.27                                            
Region United States (us)                                
Web Interface http://127.0.0.1:4040                             
Forwarding http://12345678.ngrok.io -> https://127.0.0.1:8081
Forwarding https://12345678.ngrok.io -> https://127.0.0.1:808
                                                                                
Connections ttl opn rt1 rt5 p50 p90       
                              0 0 0.00 0.00 0.00 0.00

```

This status window willbe displayed as long as I dont do a CTRL-C command.

If I try to send the same command lin via an 'exec' node, I just get a reply with the PID, no matter wich option I select in the exec node, I just get this PID value.  
How can I do to get the content of the return window wich is displayed in the terminal?

The goal of my question is to be able to intercept the line 🙂  
`Forwarding https://12345678.ngrok.io`  
Is this possible?

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [6 May 2019 22:08 UTC](https://discourse.nodered.org/t/return-values-from-terminal/10864/2 "2019-05-06T22:08:24Z")

</div>

Connect a debug node to the bottom output of the exec node. And run the exec node in spawn mode.

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [6 May 2019 23:43 UTC](https://discourse.nodered.org/t/return-values-from-terminal/10864/3 "2019-05-06T23:43:03Z")

</div>

> [@mike67](#):
>
> The goal of my question is to be able to intercept the line 🙂  
> `Forwarding https://12345678.ngrok.io`

Did you consider using [ngrok API](https://ngrok.com/docs#client-api) to read the tunnel data ? You just need an `http request node` configured as below:

![ngrok-api-tunnels](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/46188e923599e73178e10bdaa7455f9ffbcc5e38.png)

---

<div class="post-metadata">

**Author:** ![mike67](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@mike67](https://discourse.nodered.org/u/mike67)\
**Post date:** [7 May 2019 05:44 UTC](https://discourse.nodered.org/t/return-values-from-terminal/10864/4 "2019-05-07T05:44:15Z")

</div>

Yes, using the API gives all the wanted result. Very good solution  
Thanks a lot
