Solved

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

Posted on 2007-04-04
2
403 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Fine Tune your automatic Updates for Ubuntu / Debian
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

751 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