Task
Execute a system command and get its output into the program. The output may be stored in any kind of collection (array, list, etc.).




Related task
  Execute a system command


import osproc
 
# Output string and error code
let (lsalStr, errCode) = execCmdEx("ls -al")
 
echo "Error code: " & $errCode
echo "Output: " & lsalStr
 
 
# Output string only
let lsStr = execProcess("ls")
 
echo "Output: " & lsStr
 