Phoenix Shell (psh)#
The Phoenix Shell is a compact program that enables you to control Phoenix-RTOS from the command line.
psh
presents itself with a command line where user can enter commands to control the Phoenix-RTOS system, manage files
and processes.
Overview#
Usage#
If the psh
is in control of the command line each new line starts with (psh)%
prompt. The user can then enter the
desired command. See Applets for a list of available commands.
If the psh
command is run with -h
parameter the help message is displayed as follows:
usage: psh [options] [script path] or no args to run shell interactively
-i <script path>: selects psh script to execute
-h: shows this help message
With -i
option psh
can execute a script - fixed set of psh
commands saved in file.
Applets#
In psh
, each command or set of commands is a separate applet. The basic usage of the majority of these applets is
compatible with POSIX standards. For example, ls
works like the ls
user command on Ubuntu
(or other Linux distribution), except for particular arguments that are not supported.
The Phoenix Shell is in ongoing development, which means its behavior can slightly vary,
particularly as new features are introduced.
Here’s a list of the available applets:
bind
- binds device to directorycat
- concatenate file(s) to standard outputcd
- change working directoryclear
- clear the terminal screencp
- copy filedate
- print/set the system datedd
- copy a file according to the operandsdf
- prints filesystem statisticsdmesg
- read kernel ring bufferecho
- display a line of textedit
- text editorexec
- replace shell with the given commandexit
- exits shellexport
- set and export variables list to environmenthelp
- prints this help messagehistory
- prints commands historyhm
- health monitor, spawns apps and keeps them aliveifconfig
- configures network interfaceskill
- terminates processln
- make links between filesls
- lists files in the namespacemem
- prints memory mapmkdir
- creates directorymount
- mounts a filesystemnc
- TCP and UDP connections and listensnslookup
- queries domain name serversntpclient
- set the system’s date from a remote hostperf
- track kernel performance eventsping
- ICMP ECHO requestspm
- monitors processesprintenv
- print all or part of environmentps
- prints processes and threadspshapp
- deliverspsh
interpreter,exit
,pshlogin
andhistory
commandspshlogin
- launchespsh
with user authenticationpwd
- prints the name of current working directoryreboot
- restarts the machinereset
- restore terminal from abnormal staterm
- unlink files or remove empty directoriermdir
- remove empty directoriessync
- synchronizes devicesysexec
- launch program from syspage using given maptop
- top utilitytouch
- changes file timestamptty
- print or replace interactive shell tty deviceumount
- unmount a filesystemunset
- unset list of environment variablesuptime
- prints how long the system has been runningwget
- downloads a file using http/
- executes a file
Executing#
When executing the psh
from a name “psh” it is only possible to enter interactive mode or execute a script with -i
.
If the psh
is launched with a different name that corresponds to an available applet then the new psh
executes only
that applet and then close. Executing psh
with a different name can be achieved using symbolic links.
Restrictions#
Only one interactive session of the psh
can be run in a scope of a psh
process. For now, running psh
does not
spawn a new process, so in order to invoke a second, independent shell user must execute a psh
binary file.
See exec
or /
for examples.