This script loads the fork_loop executable, sets its default startup arguments, and steps one source-level statement.
If you stored this in a file named fork_loop.tvd, you could tell NextGen TotalView for HPC to start the CLI and execute this file by entering the following command:
totalviewcli -s fork_loop.tvd
The following example places a similar set of commands in a file that you 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 ignores the backslash continuation character; Tcl processes it. This means that the shell executes the exec command while Tcl ignores it.