hello
i have found this flow, which scan a network, the output is just empty so i added a second msg.payload where i got a error
/bin/bash: sudo: command not found
my node Red is in a Containers on my pi itself it would work
[{"id":"c3961d41.0f858","type":"tab","label":"Scan Subnet for Devices","disabled":false,"info":""},{"id":"842fa7ed.314678","type":"inject","z":"c3961d41.0f858","name":"","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"string"}],"repeat":"60","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":150,"y":60,"wires":[["c43bcf07.4070d"]]},{"id":"c43bcf07.4070d","type":"exec","z":"c3961d41.0f858","command":"sudo nmap -sn 10.18.42.0/24 | awk '/Nmap scan report for/{printf $5;}/MAC Address:/{print \"|\"substr($0, index($0,$3)) }' | sort","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"scan subnet","x":370,"y":60,"wires":[["6903a852.c6bd58"],["65f5cef1.0da3c"],[]]},{"id":"6903a852.c6bd58","type":"function","z":"c3961d41.0f858","name":"Subnet Devices Array","func":"let response = msg.payload.split('\\n');\nlet found = []\nlet device\nresponse.forEach ( line => {\n if ( line.indexOf('|') > -1 ){\n device = {\n ip : line.split('| ')[0],\n mac: line.split('|')[1].split(' ')[0],\n brand: line.split('|')[1].split(' ')[1]\n }\n found.push ( device )\n }\n})\nmsg.payload = found;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":600,"y":60,"wires":[["c5c606d2.36a7f8"]]},{"id":"c5c606d2.36a7f8","type":"debug","z":"c3961d41.0f858","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":850,"y":60,"wires":[]},{"id":"65f5cef1.0da3c","type":"debug","z":"c3961d41.0f858","name":"test Output","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":860,"y":220,"wires":[]}]