The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
how to redirect the output of a grep command to a file inside a shell script kripssmart Shell Programming and Scripting 11 06-19-2008 07:28 AM
how to get the output of a grep command to a file inside a shell script kripssmart UNIX for Dummies Questions & Answers 1 06-16-2008 03:12 PM
Script that Redirect SSH output via cron primp Shell Programming and Scripting 4 06-14-2008 02:46 PM
[BASH] redirect standard error and use it inside Pescator Shell Programming and Scripting 2 03-03-2008 09:20 AM
how to find Script file location inside script asami Shell Programming and Scripting 10 03-15-2006 12:57 AM

 
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 06-24-2008
alex_5161 alex_5161 is offline
Registered User
  
 

Join Date: Jan 2007
Location: Detroit
Posts: 124
How redirect script output from inside of script?

Is it possible to redirect a script output by command inside of that script?

I mean, if I have a script 'dosome.sh' I could run it by
Code:
>dosome.sh > dosome.log
I would dream to get some command inside of scrip to do the same; so, running the dosome.sh would have all output redirected to a log file

(Do not advise, please, put redirection to a log file from every command of that script. It is already unrealistical.)
So I would image something like that:
Code:
#! /usr/bin/bash
 
<redirection command>

....
.... script body
....
# end of script
Iven would be greate to be able to do it the same as it would be done with 'tee' command: to have the output be written to file and in the same time to standard output, to screen, like in this command:
Code:
>dosome.sh | tee dosome.log
Appreciate any advice!
 

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 11:16 PM.


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