Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Viewing job actions at command line while job running?

Status
Not open for further replies.

ash1ey

Technical User
Jul 12, 2002
2
US
There is a way to run a unix script and see at the command line what actions it is doing. From what I remember to get this you had to put something like -X after executing the script name ie; > test.sh -X.
 
You mean run it in the background and get another command prompt?

Like "test.sh &"?
 
Thanks for replying, not quite. I was once shown a way to run a script that was doing a rsh to another box, and to see what action the script was doing I run the script at the command line and Im sure I put something like -X after the script name, then while the scipt executes below the command line you could see the scipt action, like it doing its rsh to the box and so forth, so forth. It was a sinple way to see where my scipt is error'ing.
 
Haven't heard of your particular example with "-X", but I know two alternate methods. One is to use the tee command and pipe it to a file, then you could use tail in another window and watch the output (command |tee>out.file). Another way is to use the script command to keep a record of everything that occurs on your screen. Not sure if this helps you.
 
If your script is a ksh script, try adding 'set -x' at the begiging of the script. You will see the script echoing its execution steps to the screen as it goes.

Your milage may vary with other shell [shell scripts] - 'man ksh'

vlad
+---------------------------+
|#include<disclaimer.h> |
+---------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top