Sponsored Content
Top Forums Shell Programming and Scripting Echo both to the screen and to a file Post 302756783 by Scott on Wednesday 16th of January 2013 01:44:08 PM
Old 01-16-2013
Read up on the tee command.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

echo or print to screen and file

I did a search for this topic but I couldn't find it and I was sure I have seen something similar before (hard because I am not sure of the criteria for the keywords) What I was looking for was to be able to echo a message to the screen from a bash.sh script at the same time logging it to a... (2 Replies)
Discussion started by: Shakey21
2 Replies

2. 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

3. 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

4. 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

5. 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

6. OS X (Apple)

Virtual screen accessed by Screen Sharing

Hi, I'm trying to create a virtual screen, (maybe xvfb? or any other virtual screen buffer) and be able to use Screen Sharing to connect to it. The setup is that I have a Mac Mini connected to the TV. But when my girlfriend is using Front Row, I can't use Screen Sharing at the same time from... (0 Replies)
Discussion started by: linge
0 Replies

7. Shell Programming and Scripting

Redirect an "echo" to log and screen?

Hi folks. Within a script, i am trying to redirect the output of my commands to both log file and onscreen... Here is the section, where i write to the logfile. But i'd like to send the "echo "Creating LUN $2$COUNTER..." to screen as well... Can that be done? Thanks. { subtitle... (2 Replies)
Discussion started by: Stephan
2 Replies

8. Red Hat

command line tool to disable screen lock and/or screen saver

Hi, I have a simple question : how to disable screen lock and/or sreen saver with command line with RHEL5.4 ? (1 Reply)
Discussion started by: albator1932
1 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. UNIX for Dummies Questions & Answers

Accidentally made a screen within a screen - how to move it up one level?

I made a screen within a screen. Is there a way to move the inner screen up one level so that it is at the same level as the first screen running from the shell? (2 Replies)
Discussion started by: phpchick
2 Replies
tee(1)								   User Commands							    tee(1)

NAME
tee - replicate the standard output SYNOPSIS
tee [-ai] [file...] DESCRIPTION
The tee utility will copy standard input to standard output, making a copy in zero or more files. tee will not buffer its output. The options determine if the specified files are overwritten or appended to. OPTIONS
The following options are supported. -a Appends the output to the files rather than overwriting them. -i Ignores interrupts. OPERANDS
The following operands are supported: file A path name of an output file. Processing of at least 13 file operands will be supported. USAGE
See largefile(5) for the description of the behavior of tee when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of tee: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 The standard input was successfully copied to all output files. >0 The number of files that could not be opened or whose status could not be obtained. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
cat(1), attributes(5), environ(5), largefile(5), standards(5) SunOS 5.10 20 Dec 1996 tee(1)
All times are GMT -4. The time now is 05:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy