Solved

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

Posted on 2007-04-04
2
418 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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

628 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