
GRMON3-UM
June 2019, Version 3.1.0
207
www.cobham.com/gaisler
99. usrsh - syntax
NAME
usrsh - Run commands in threaded user shell
SYNOPSIS
usrsh
usrsh
subcommand
?
arg
?
DESCRIPTION
The usrsh command is used to create custom user shells. Each custom shell has an associated Tcl interpreter
running in a separate thread. Log output from a custom user shell is prefix with its name (see description of the
-log
option in Section 3.2.3, “General options”).
usrsh
usrsh list
List all custom user shells.
usrsh add
name
Create a user shell named
name
. The name is used as an identifier for the shell when using other usrsh
commands.
usrsh delete
name
Delete user shell
name
.
usrsh eval ?
-bg
? ?
-std
?
name
arg
?
arg ...
?
Evaluate command
arg
in the user shell identified as
name
. If a script is running, then the command will
fail with the error code set to EBUSY.
If the option
-bg
is set, then the script will be evaluated in the background, and GRMON will return to
the prompt.
If the option
-std
, in combination with option
-bg
, then output from the background operation will be
forwarded to the current shells stdout.
usrsh result
name
Retrieve the result from the last evaluation. If a script is running, then the command will fail with the error
code set to EBUSY.
RETURN VALUE
Upon successful completion usrsh list will return a list of all custom user shells.
usrsh eval will return the result from the script. If the option
-bg
then nothing will be returned. Instead the usrsh
result will return the result when the script is finished.
EXAMPLE
Create a user shell named
myshell
and evaluate a command in it.
grmon3> usrsh add myshell
Added user shell: myshell
grmon3> usrsh eval myshell puts "Hello World!"
Hello World!
Evaluate command in user shell named
myshell
in the background and wait for it to finish.
grmon3> usrsh eval -bg myshell {after 2000; expr 1+1}
grmon3> while {[catch {usrsh result myshell}] && $errorCode == "EBUSY"} {puts "waiting"; after 1000}
waiting
waiting
grmon3> puts [usrsh result myshell]
2
Содержание GRMON3
Страница 56: ...GRMON3 UM June 2019 Version 3 1 0 56 www cobham com gaisler...
Страница 114: ...GRMON3 UM June 2019 Version 3 1 0 114 www cobham com gaisler...
Страница 123: ...GRMON3 UM June 2019 Version 3 1 0 123 www cobham com gaisler dcache...
Страница 156: ...GRMON3 UM June 2019 Version 3 1 0 156 www cobham com gaisler SEE ALSO Section 6 13 On chip logic analyzer driver...
Страница 208: ...GRMON3 UM June 2019 Version 3 1 0 208 www cobham com gaisler SEE ALSO Section 3 5 Tcl integration...