Return
|
You want to see commands in a initialization (or other) script, as they are being executed.
Use the -xv shell options. This is similar
in effect to the DCL command SET VERIFY.
The -x shell option prints commands and their
arguments as they are executed. The -v option
prints shell input lines (i.e. the script's source code lines)
as they are read.
There are three basic ways of turning on script verification:
Invoke the shell with these options on the command line.
unix> sh -xv myScript.sh | more
SET VERIFY
this can produce a lot of output, so you
may want to pipe the resulting text through a pager
or redirect it to a temp file.
Invoke the options on the initial 'shebang' line of the script:
#!/bin/sh -xv
(See 3.1 for more information
about the shebang line.)
Use the ksh set command to turn these options
on and off as needed:
set -x; # Turn on tracing with variable substitution...
:
:
unset -x; # Turn off tracing...
3.1 - Creating Shell Scripts;
Chapter 10 of Unix for OpenVMS Users
;
Chapter 48 of Unix Power Tools
.
  Return
|
|
Colophon: |
|
||||
|
This page maintained by: Bill.Costa@unh.edu of the Enterprise Computing Group in the dept of Computing & Information Sevices at the University of New Hampshire |
|
||||