SYNTAX

    fshell [options] [<script_name>] [<script_args>]


OPTIONS

-h (--help) bool

Display help.

-e (--exec) string

Execute the specified one line script.

-k (--keep-going) bool

When running in script mode, keep processing the script even if a previous command has returned an error. Without this option set, an error would cause the processing to abort (and fshell to exit with the error code) unless either &&, || or &| was used to handle the error. For the convenience of scripts that may wish to pass on the flag to sub-instances of fshell, if this flag is specified the environment variable KEEP_GOING is defined.

-c (--cd) filename

Set fshell's default current working directory to the given path. Overrides the path inherited from the environment variable PWD.


ARGUMENTS

[<script_name>]

The name of a script file to be executed. If a path isn't specified, and script_name is not a file in the current working directory, the directory \system\console\scripts is searched on all drives. [filename]

[<script_args>]

Arguments to be send to the script. Any further arguments or options will be coalesced into this one. [string]


DESCRIPTION

A UNIX-like shell for Symbian OS.

Introduction

fshell is a console based executable for Symbian OS that behaves somewhat like typical UNIX shells (e.g. Bash, http://www.gnu.org/software/bash/ ). It can be used via a remote console implementation on hardware that doesn't have a full keyboard, giving an experience similar to telnet. fshell contains a set of built-in commands and is also able to launch arbitrary Symbian OS executables. This document describes how to install fshell, how to use its built-in commands and how to use the set of external commands that are also provided.

Getting Started

See Getting Started for a description of how to get console based tools like fshell up and running on the platform you are using. Alternatively, if you would like to configure things yourself, see Console Options for a description of the technology that's available for hosting consoles.

fshell is more like a UNIX shell than a DOS one, so it supports commands like cd Z:\, ls, mkdir and rm. It does also support the DOS-style equivalents z: dir, md, and del via internal fshell aliases. However, you still can't execute eshell *.bat files directly, although you can launch eshell from within fshell by typing 'eshell' so it is possible to run them indirectly if you need to. In practice, many simple bat files can run as fshell scripts due to fshell providing broadly-compatible commands.

General fshell Functionality

Commands

All commands support the -h (or --help) option, which causes them to display text describing what they do and the syntax they support.

A list of all the supported commands is available here.

Scripting Support

fshell supports simple scripting to allow more than one command to be run in succession. Scripts can be invoked in multiple ways:

Scripts may contain any number of valid fshell command lines. Separate script files may be run in the context of a single fshell instance by using the source command. Note, when fshell runs a script, it defines the following environment variables within itself before doing so:

Global Command Line Options

All commands, including fshell itself, have the following common set of command line options which control where/how the command runs. These global options are not generally listed when you run command --help. There are no short alternatives for these options.

Advanced command-line syntax

Short options may be run together in one block, the only restriction being that an option that takes and argument can only appear as the last option in the block. For example the following are equivalent:

    kill --all --thread --match *undertaker
    kill -a -T -m *undertaker
    kill -aTm *undertaker

Commands that have options that can be specified multiple times can be called in a number of different ways, partly depending on the type of the option. In the most basic case, you can specify the long or the short option repeatedly:

    echo --attributes bold --attributes underscore "hello!"
    echo -a bold -a underscore "hello!"

For integer options, you can use the above or you can use commas. All of the below are valid fshell syntax and mean exactly the same:

    btrace --filter 1 --filter 3
    btrace --filter 1,3
    btrace -f 1,3
    btrace -f1,3

For boolean options, you can additionally specify the short option multiple times in the same block. All of the below mean the same:

    fcontacts -v -v list
    fcontacts --verbose -v list
    fcontacts -vv list

For most commands, it doesn't matter where you put the options - they can go before, after or mixed in with the arguments. The following are all equivalent:

    cat --binary file1 file2
    cat -b file1 file2
    cat file1 file2 -b
    cat file1 -b file2

The only exception to this is commands that are designed to take other command-lines as their arguments. These will not parse options themselves if they appear as part of the arguments. For example the repeat command will not parse -k if it appears during the command argument, even though -k is a valid option for repeat. Therefore:

    repeat -k 3 ps

is different to:

    repeat 3 ps -k

The former means "repeat ps three times, and specify the -k repeat option". The latter means "repeat ps -k three times". Commands that parse in this way can be identified by the phrase "Any further arguments or options will be coalesced into this one." which appears in their documentation. They are specifed in CIF files using the last keyword. The precise rule for how last behaves can be stated as: If the command line following the last argument would need quoting or escaping to make it a single string argument, the string is taken literally as-is. Otherwise, the normal expansions take place:

    c:\>echo This^ gets^ expanded^ as^ expected
    This gets expanded as expected
    c:\>echo "Quoting the entire argument works as normal as well"
    Quoting the entire argument works as normal as well

But a command line that has unescaped spaces or quotes will cause the entire thing to be taken literally:

    c:\>echo This is taken as one string even though it has spaces and 'unbalanced quotes"
    This is taken as one string even though it has spaces and 'unbalanced quotes"
    c:\>echo Note how escapes like ^r^n aren't expanded
    Note how escapes like ^r^n aren't expanded
    c:\>echo "But if it's all in quotes, escapes like ^r^n are expanded"
    But if it's all in quotes, escapes like 
     are expanded

Environment variables are always expanded unless the entire argument is enclosed in 'single quotes'.


SEE ALSO

fshell commands

consoles

CIF file syntax


COPYRIGHT

Copyright (c) 2006-2011 Accenture. All rights reserved.