Startup Example
Consider this simple CLI script that loads the fork_loop executable, sets its default startup arguments, and steps one source-level statement.:
catch {make_actions fork_loop.cxx} msg
puts $msg
If you save this script to a file named fork_loop.tvd, you can start the CLI and execute this file using this command:
totalviewcli -s fork_loop.tvd
The following example places a similar set of commands in a file to invoke from the shell:
#!/bin/sh
# Next line executed by shell, but ignored by Tcl because: \
exec totalviewcli -s "$0" "$@"
dload fork_loop
dset ARGS_DEFAULT {0 4 -wp}
dstep
catch {make_actions fork_loop.cxx} msg
puts $msg
These two examples are essentially the same except for the first few lines in the second example. In the second example, the shell does not respond to the backslash continuation character; Tcl processes it. This means that the shell executes the exec command while Tcl does not process it.