The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
capture output of file and send last string thereof to new file Lorna Shell Programming and Scripting 6 10-06-2008 05:38 PM
script to capture certain output fara_aris Shell Programming and Scripting 18 08-15-2008 12:07 AM
capture shell output in cron entry steve72 UNIX for Dummies Questions & Answers 5 04-17-2008 12:00 PM
Capture output to file and printer rdasari UNIX for Advanced & Expert Users 1 01-16-2008 03:57 PM
Capture output from interactive script MizzGail Shell Programming and Scripting 6 04-04-2002 06:24 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 01-13-2009
rajan_san rajan_san is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 39
Capture Shell Script Output To A File

Hi,

I am running a shell script called dbProcess.sh which performs shutdown and startup of various Oracle instances we have.At the time of execution the script produces the following output to the command line window

$./dbProcess.sh stop

#### Run Details ######
Hostname : server-hop-1
RunDate : 01-13-09
RunTime : 09:43:14
#### ########### ######
##############################################################################
/u01/app/oracle/product/9.2
/u01/app/oracle
it9
##############################################################################
##############################################################################
# Setting Environment Variables For SID : # it9
##############################################################################
##############################################################################
# Contents Of Connection Out File #
##############################################################################
##############################################################################
# Killing Active DB Connections #
##############################################################################
Connected.
Database closed.
Database dismounted.
ORACLE instance shut down.
##############################################################################

I would like to create an output file being at the time of executing the dbProcess.sh and the process must write all the output lines of the dbProcess.sh to this file.

I would like to clarify that i am not looking for any kind of redirection commands using the > or >> symbol.

What i am looking out for is a series of commands that i will be able to add to my dbProcess.sh shell script which will start a log file write all the shell output to the logfile and at the end of it save and exit the log file. I dont mind if the output is not showing up on the stdout for me most important aspect is the creation of this logfile and to write all output to this logfile.

I tried the to add lines to dbProcess.sh using the unix script command.But it did not work because when the shell script executed the script command line it stopped and waited for me to type exit for it to continue.

Please let me know if you have any clarification.

Thanks and kind Regards,
Rajan.S
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:26 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0