Command Line

This sample demonstrates a simple app running inside a sandbox that prints information about files or directories specified from the command line. It has an adef with an executables section, and cdef with sources section.

Go to the sample app code.

Run this to install the sample app:

$ cd apps/sample/commandLine
$ make wp85
$ update fileInfo.wp85.update <ip address>

If you're not using a Sierra Wireless WP85xx module, replace wp85 with the appropriate identifier for your target.

This sample app takes a command with a list of file/directory paths, and accepts additional options like -x or --max-count.

Here's an example on how to run the command-line sample app:

Change to the sandbox directory:

cd /legato/systems/current/apps/<appname>/read-only/bin

This is how to access a regular file:

root@swi-mdm9x15:/legato/apps/bb20bdcce7eb03179af9c62adf619e19/read-only/bin# ./fileInfo type /etc/hosts --max-count=10

This is how to access permissions to control read/write, group members' and others' read access:

root@swi-mdm9x15:/legato/apps/bb20bdcce7eb03179af9c62adf619e19/read-only/bin# ./fileInfo permissions /etc/hosts --max-count=10
The long hexadecimal number in the apps' directory is unique to each installed app.

Install and Start App

Create Apps