# Help with shell command to get a result in a node

**URL:** <https://discourse.nodered.org/t/help-with-shell-command-to-get-a-result-in-a-node/15548>\
**Category:** General\
**Created:** [15 September 2019 08:03 UTC](https://discourse.nodered.org/t/help-with-shell-command-to-get-a-result-in-a-node/15548 "2019-09-15T08:03:05Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [15 September 2019 08:35 UTC](https://discourse.nodered.org/t/help-with-shell-command-to-get-a-result-in-a-node/15548/6 "2019-09-15T08:35:31Z")

</div>

> [@Steve-Mcl](#):
>
> You could probably do it with JSONata (but I have no clue how).

Or in JSONata in a change node after the command output, set as Payload to JSONata expression.  
`$number($match(payload, /(\d+)/)[0]['groups'][0])`  
(Typing from phone, pretty sure it’s typo free but untested)

What this does is execute the regex on the payload string to get the number out but still as a string, then parse it to a number and return it.

---

_[View the full topic](https://discourse.nodered.org/t/help-with-shell-command-to-get-a-result-in-a-node/15548)._
