Update to the original question with more input...
- from the on-line execution of wolfram
Wolfram Language (Raspberry Pi Pilot Release)
Copyright 1988-2016 Wolfram Research
Information & help: wolfram.com/raspi
In[1]:= arduino=DeviceOpen["Arduino","/dev/ttyACM0"];
In[2]:= arduino
Out[2]= DeviceObject[{Arduino, 1}]
In[3]:= allpins=DeviceRead[arduino,{2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}];
In[4]:= allpins
Out[4]= ArduinoLinkPrivate
ArduinoReadDriver[{e30e0b83-13f8-4f26-85d2-1eff85d6\
8587, SerialLink`SerialPort[/dev/ttyACM0, {115200, 8, None, None, None}]}
, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
- content of readpin2.wl script file
arduino=DeviceOpen["Arduino","/dev/ttyACM0"];
arduino
allpins=DeviceRead[arduino,{2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19}];
allpins
- execution of the script file
pi@rPi3:/Shared/wolfram
$ wolfram -script readpin2.wl
pi@rPi3:/Shared/wolfram $ wolfram -script readpin2.wl > xxx.txt
pi@rPi3:/Shared/wolfram $ ls -l
-rw-r--r-- 1 pi pi 139 Aug 25 17:33 readpin2.wl
-rw-r--r-- 1 pi pi 0 Aug 25 18:32 xxx.txt
So, how can I get output from the executing script file?