Solved

In a c shell, how does one redirect stdout to both a log file and also screen?

Posted on 2007-04-04
2
376 Views
Last Modified: 2013-12-26
Several years ago I did several UNIX script with Korn shell; however the c shell bit is different.

How does one capture information in both a file "and" to the screen in the same c shell script?
For example i can do the following:

echo " operation x y z was successful"  >>! test.log


echo " operation x y z was successful " > /dev/tty

Now how does capture in the log and display on the screen? I know you may write double statments for redirecting to log and screen. Is there a clean way to do this in a c shell?

Thanks in Advance

Rick
0
Comment
Question by:WmRichard
2 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
ID: 18852690
echo " operation x y z was successful" | tee -a  test.log
0
 

Author Comment

by:WmRichard
ID: 18853068
Outstanding!

Thank you!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Thin secure Windows 10 5 49
Is this bug still active in RHEL 2 31
Virtual Box issue 6 52
Making an alias 7 54
Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now