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 with parameters output to logfile 1

Status
Not open for further replies.

doctorray

Technical User
Mar 23, 2004
1
US
Hi!
I have a script and I need the logfile to capture exactly what I type on the command line (the script name with paramaters).
For example,
TESTING -O Option1 -C Case1
should be written to the logfile like this:
TESTING -O Option1 -C Case1

How can I do that? Please help.

DR.
 
In the script you can do :
[tt]
echo "$0 $*" >> logfile
[/tt]

If you want to log the command outside the script, use the 'script' command. It log into a file al the input and output from the terminal.

Jean Pierre.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top