# EXEC node behaves different than regular terminal

**URL:** https://discourse.nodered.org/t/exec-node-behaves-different-than-regular-terminal/52539
**Category:** General
**Created:** [22 October 2021 03:41 UTC](https://discourse.nodered.org/t/exec-node-behaves-different-than-regular-terminal/52539 "2021-10-22T03:41:45Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![leoneltoledo](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@leoneltoledo](https://discourse.nodered.org/u/leoneltoledo)
#### Post date: [22 October 2021 03:41 UTC](https://discourse.nodered.org/t/exec-node-behaves-different-than-regular-terminal/52539/1 "2021-10-22T03:41:45Z")

</div>

I have noticed before that EXEC node doesn't always behave in the same way as terminal. But this is a particular case

Trying to execute a simple command:  
dig -f lista.txt @1.1.1.1 | grep -E '\<\<\>\>|status|time'

This command executes dig to a list of URLs contained in a file, and then filter results using grep

When using terminal window the comand works as expected:

```auto
; <<>> DiG 9.11.3-1ubuntu1.15-Ubuntu <<>> www.amazon.com
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 1599
;; Query time: 37 msec
...

```

Now, when trying to execute the same command with EXEC node (using same PC):

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/3/43aa1f0a71faf9e0f2a49c0935f9eee4cee77ec8.png)

```auto
; <<>> DiG 9.11.3-1ubuntu1.15-Ubuntu <<>> 1634871188880 -f lista_url.txt @1.1.1.1
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 45038
;; Query time: 36 msec
; <<>> DiG 9.11.3-1ubuntu1.15-Ubuntu <<>> www.amazon.com
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4334
;; Query time: 58 msec
...

```

in this case, dig first tries to use the arguments of the command line (and a number which I cannot identify the source) as if they were an URL, then execute the command as expected, reading the URLs from the specified file.

Currently using node-red v2.1.0 and Node.JS v14.18.1

---

<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: [22 October 2021 04:33 UTC](https://discourse.nodered.org/t/exec-node-behaves-different-than-regular-terminal/52539/2 "2021-10-22T04:33:56Z")

</div>

> [@leoneltoledo](#):
>
> and a number which I cannot identify the source

You are injecting `msg.payload`, uncheck the "append msg.payload"

---

<div class="post-metadata">

### Author: ![leoneltoledo](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@leoneltoledo](https://discourse.nodered.org/u/leoneltoledo)
#### Post date: [22 October 2021 13:25 UTC](https://discourse.nodered.org/t/exec-node-behaves-different-than-regular-terminal/52539/3 "2021-10-22T13:25:01Z")

</div>

Such a sylly mistake! 😊

Now it works as expected

Thank you very much

---

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [22 October 2021 16:07 UTC](https://discourse.nodered.org/t/exec-node-behaves-different-than-regular-terminal/52539/4 "2021-10-22T16:07:49Z")

</div>

It's the number one error that we all make with this node 🙂

---

<div class="post-metadata">

### Author: ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)
#### Post date: [22 October 2021 16:59 UTC](https://discourse.nodered.org/t/exec-node-behaves-different-than-regular-terminal/52539/5 "2021-10-22T16:59:21Z")

</div>

The default is now not to append so you have to willfully make it so 🙂

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [21 December 2021 17:00 UTC](https://discourse.nodered.org/t/exec-node-behaves-different-than-regular-terminal/52539/6 "2021-12-21T17:00:05Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
