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!

Script Log

Status
Not open for further replies.

Midrange

Vendor
Aug 28, 2002
135
SG
Hi there I'm new with the AIX Script. I just want to know how can I create a log file for the whole series of my script aside from redirecting per command on script to the log file.. Can I set from the beginning of my program up to the end of my script and how?

Thanks,
Eldan
 
#!/bin/ksh

# redirect stdout to fd=3
exec 3>&1 > /tmp/a.log
ls -l /tmp
# more stuff here
# even MORE here
#
# restore old stdout and closefd=3
exec >&3 3>&-
vlad
+---------------------------+
|#include<disclaimer.h> |
+---------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top