Sponsored Content
Top Forums UNIX for Dummies Questions & Answers echo or print to screen and file Post 12958 by Shakey21 on Wednesday 9th of January 2002 06:56:21 PM
Old 01-09-2002
thanks

thats exactly what I was looking for.
Shakey21
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

is it possible to echo 'some text' every 10 minutes on my screen

is it possible to echo 'some text' every 10 minutes on my screen continues , without cron. (1 Reply)
Discussion started by: vkandati
1 Replies

2. UNIX for Dummies Questions & Answers

set variable to Home, then echo it to screen

Major Newbie here folks. I'm trying to set a variable to my Home directory and then echo it to the screen. Any and all help is greatly appreciated. Thanks Anna (3 Replies)
Discussion started by: amidget
3 Replies

3. Shell Programming and Scripting

print to screen and to file using awk?!

Hello all!.. does anyone know the syntax to print to the screen and to a file? Im using something like AWK .... print header |tee -a invalid_csv_file ; END {..} ' invalid_csv_file="$invalid_csv_dir_file" but no joy? I get sh:... (2 Replies)
Discussion started by: satnamx
2 Replies

4. Shell Programming and Scripting

perl - print to a log file and screen

as the title suggests, i need to print a user message to a log file and the screen using perl. in unix i set up a function using 'tee' like so function Display_Message { echo "$*" | tee -ai $LOGFILE } the following command then obviously displays to the screen and prints to a log... (6 Replies)
Discussion started by: mjays
6 Replies

5. AIX

print screen

Hi all, Could you please tell me how to take a screenshot in aix (like Print Screen button in windows)? Thanks (7 Replies)
Discussion started by: prashantchavan
7 Replies

6. Shell Programming and Scripting

echo to both screen and a file

Please help me to simplify my below script. #!/bin/bash LOG_FILE=/tmp/log.txt echo "Hello" echo "Hello" >> /tmp/log.txt Is there anyway, that I can echo "Hello" to both screen and file with one single echo command ? (6 Replies)
Discussion started by: phamp008
6 Replies

7. Shell Programming and Scripting

echo 2 txt files to screen no carraige return

I have two text files, each of then only containing ONE line and NO carraige return or white space at the end...how do I echo both of these text files to the screen without putting an extra line? I want to do this from the command line. file1.txt: this is file1.txt 1 file2.txt: this is... (4 Replies)
Discussion started by: ajp7701
4 Replies

8. UNIX for Dummies Questions & Answers

how to print script output to screen and file

Hi all, I have a script that bulk loads thousands of lines of data. I need to log the output during the execution of the script. I know I can redirect (">") the output to a file; however, I want the output going to both the screen and the log file. I thought I could use pipe to pipe the... (10 Replies)
Discussion started by: orahi001
10 Replies

9. Shell Programming and Scripting

echo command with screen and ssh

Hi, i need to execute echo command to write in a txt file on a remote machine. i did it in this way: ssh user@remotemachine "echo "put text here" > /home/user/myfile.txt" I tried to run the same command within a detached screen in this way: ssh user@remotemachine screen -dm "echo "put... (3 Replies)
Discussion started by: brembo
3 Replies

10. Shell Programming and Scripting

Echo both to the screen and to a file

In shellscript, I want to display echo message in console and in the log file. please help me to display this message in two places. I am using below statment to display messsage, but it is displaying in log file only. echo "Server Already running" >> serverlog 2>&1 (3 Replies)
Discussion started by: Kri
3 Replies
Tee(3pm)						User Contributed Perl Documentation						  Tee(3pm)

NAME
IO::Tee - Multiplex output to multiple output handles SYNOPSIS
use IO::Tee; $tee = IO::Tee->new($handle1, $handle2); print $tee "foo", "bar"; my $input = <$tee>; DESCRIPTION
"IO::Tee" objects can be used to multiplex input and output in two different ways. The first way is to multiplex output to zero or more output handles. The "IO::Tee" constructor, given a list of output handles, returns a tied handle that can be written to. When written to (using print or printf), the "IO::Tee" object multiplexes the output to the list of handles originally passed to the constructor. As a shortcut, you can also directly pass a string or an array reference to the constructor, in which case "IO::File::new" is called for you with the specified argument or arguments. The second way is to multiplex input from one input handle to zero or more output handles as it is being read. The "IO::Tee" constructor, given an input handle followed by a list of output handles, returns a tied handle that can be read from as well as written to. When written to, the "IO::Tee" object multiplexes the output to all handles passed to the constructor, as described in the previous paragraph. When read from, the "IO::Tee" object reads from the input handle given as the first argument to the "IO::Tee" constructor, then writes any data read to the output handles given as the remaining arguments to the constructor. The "IO::Tee" class supports certain "IO::Handle" and "IO::File" methods related to input and output. In particular, the following methods will iterate themselves over all handles associated with the "IO::Tee" object, and return TRUE indicating success if and only if all associated handles returned TRUE indicating success: close truncate write syswrite format_write formline fcntl ioctl flush clearerr seek The following methods perform input multiplexing as described above: read sysread readline getc gets eof getline getlines The following methods can be used to set (but not retrieve) the current values of output-related state variables on all associated handles: autoflush output_field_separator output_record_separator format_page_number format_lines_per_page format_lines_left format_name format_top_name format_line_break_characters format_formfeed The following methods are directly passed on to the input handle given as the first argument to the "IO::Tee" constructor: input_record_separator input_line_number Note that the return value of input multiplexing methods (such as "print") is always the return value of the input action, not the return value of subsequent output actions. In particular, no error is indicated by the return value if the input action itself succeeds but subsequent output multiplexing fails. EXAMPLE
use IO::Tee; use IO::File; my $tee = new IO::Tee(*STDOUT, new IO::File(">tt1.out"), ">tt2.out"); print join(' ', $tee->handles), " "; for (1..10) { print $tee $_, " " } for (1..10) { $tee->print($_, " ") } $tee->flush; $tee = new IO::Tee('</etc/passwd', *STDOUT); my @lines = <$tee>; print scalar(@lines); AUTHOR
Chung-chieh Shan, ken@digitas.harvard.edu COPYRIGHT
Copyright (c) 1998-2001 Chung-chieh Shan. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
perlfunc, IO::Handle, IO::File. perl v5.12.3 2001-03-10 Tee(3pm)
All times are GMT -4. The time now is 02:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy