The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to copy a file to a directory ,where file and dir are sent as args to a function? wrapster Shell Programming and Scripting 0 06-08-2008 04:37 AM
function definitions file for bc Pudnik Shell Programming and Scripting 0 03-09-2008 11:08 PM
How to parse through a file and based on condition form another output file sivasu.india UNIX for Advanced & Expert Users 6 02-28-2008 12:59 AM
Function output Skyybugg Shell Programming and Scripting 2 03-23-2007 12:20 PM
Calling other file function maldini Shell Programming and Scripting 3 08-18-2005 11:23 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-15-2008
Registered User
 

Join Date: Jul 2006
Posts: 36
Output function into file

I have this shell:

function AAAA {

echo $* > Log1

}

# main

AAA "TEST" > Log2

.....

I not see the same output in the 2 files ; only Log1 result with the strings $*
Log2 is without strings ....

Why?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-15-2008
Smiling Dragon's Avatar
Disorganised User
 
Join Date: Nov 2007
Location: New Zealand
Posts: 679
If you redirect stdout to a log file like that in the function ( > Log1 ), you won't see any output from the function (as it's redirected elsewhere). If you want to take the output from your echo and send it to a file but also leave it on STDOUT, use the tee command instead.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:24 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0