Shell Piping
This sample app demonstrates using a shell script and some common utilities within a sandboxed app. The script echos some messages out to the stdout and then calls 'ls' piping the result to 'grep'. The output of the script can be read from syslog by using 'logread'.
Go to the sample app code.
start: manualbundles:{file:{// Bundling the script into the sandbox with the permissions needed to run it.[rx] utilPipes /}}requires:{file:{// Adding sh (shell), ls, grep and echo utilities into the sandbox./bin/sh /usr/local/bin//bin/ls /usr/local/bin//bin/grep /usr/local/bin//bin/echo /usr/local/bin/}}processes:{run:{// Run sh (shell) and pass it the script for it to run.(sh utilPipes)}}
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.