Sponsored Content
Top Forums Shell Programming and Scripting [Solved] Writing output to the console Post 302827275 by pat0181 on Friday 28th of June 2013 11:36:37 AM
Old 06-28-2013
The command "echo "$result doesnot match with the host file" | tee -a InputHostsFileErrors.txt" only works if you want the information displayed on the terminal you are using. To display it on the console try:
Code:
echo "$result doesnot match with the host file" | tee -a InputHostsFileErrors.txt > /dev/console 2>&1

---------- Post updated at 08:36 AM ---------- Previous update was at 08:11 AM ----------

Sorry previous post was a little incorrect. While it would work it wouldn't capture and log STDERR correctly. Try this:
Code:
echo "$result doesnot match with the host file"  2>&1 | tee -a InputHostsFileErrors.txt > /dev/console

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Eleminating output to console

I am running Shorewall firewall config program to utilize iptables on a Debian 3.3.5 system. This system is setup for a getway/router. I am getting a message: Shorewall:bogons:Drop:IN=eth0 OUT= MAC+ mac address of eth0 SRC:someinternetIP DST=MYIPADD LEN=61 TOS+0x00 PREC=0x00 TTL=114 ID=6673... (3 Replies)
Discussion started by: pflink
3 Replies

2. UNIX for Dummies Questions & Answers

Writing to a file without echo it to the console !!!!

hi all, I am trying to write some message to a file using the following command. echo "${MESSAGE}" >&1 | tee -a ${File_name} can the same be done without using echo . I don't want the result to be displayed to the console. Can anyone guide me. Thanks in advance (6 Replies)
Discussion started by: amit_kv1983
6 Replies

3. UNIX for Dummies Questions & Answers

Command display output on console and simultaneously save the command and its output

Hi folks, Please advise which command/command line shall I run; 1) to display the command and its output on console 2) simultaneous to save the command and its output on a file I tried tee command as follows; $ ps aux | grep mysql | tee /path/to/output.txt It displayed the... (7 Replies)
Discussion started by: satimis
7 Replies

4. Shell Programming and Scripting

[solved] merging two files and writing to another file- solved

i have two files as file1: 1 2 3 file2: a b c and the output should be: file3: 1~a 2~b 3~c (1 Reply)
Discussion started by: mlpathir
1 Replies

5. Solaris

No Console Output

Hey everyone I have a sparc enterprise T2000 I'm trying to install solaris 10 on. The only way I can connect to it is the SER MGT console, but I'm not getting anything to display (in Hyper terminal, or PUTTY) when I boot it. Upon googleing, all I get back is "No output may have been generated.... (4 Replies)
Discussion started by: goodvikings
4 Replies

6. Shell Programming and Scripting

Grep on console output

Hellos! I want to have a unix script that will run grep on the console output. Here is what my script does: 1. Telnet into a remote server (I have done this part successfully) 2. On successful login, the remote server displays outputs information on the console. I need to run grep on that... (6 Replies)
Discussion started by: puneet1984
6 Replies

7. Shell Programming and Scripting

[Shell/Perl(?)] Prepending timestamps to console output & writing results to a file

I do a lot of TSM work and I embarked on what I thought would be an easy task, and I'd be very happy for any input to save the pounding my keyboard is receiving :] By default, the output of TSM's console has no timestamping, making it hard to sort through accurately. This puts my console into... (5 Replies)
Discussion started by: Vryali
5 Replies

8. UNIX for Dummies Questions & Answers

[Solved] Writing a loop to changing the names of files in a directory

Hi, I would like to write a loop to change the names of files in a directory. The files are called data1.txt through data1000.txt. I'd like to change their names to a1.txt through a1000.txt. How do I go about doing that? Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies

9. Solaris

[SOLVED] Console connection to V240

My apologies if this is posted/answered elsewhere. I have recently been tasked with getting 2 Sun V240's running Solaris 10 up and working. I should mention I come from the programming side of life with a small amount of networking on Windows 2003 servers. They boot, no error lights, hd's... (6 Replies)
Discussion started by: kuriosity_prime
6 Replies

10. Web Development

302 Redirects Issues Effected Google Search Console (GSC) Fixed - DBSEO Goto Rewrite Problems Solved

Finally! Yesterday I FINALLY figured out why Google Search Console (GSE) was showing so many pages with 302 redirects in our link budget. For over a year, I thought this issue was relate to either Apache2 or DBSEO (our PHP module which rewrites our links to be SEO friendly). However, when I... (5 Replies)
Discussion started by: Neo
5 Replies
CONSPY(1)							      conspy								 CONSPY(1)

NAME
conspy - virtual console spy tool SYNOPSIS
conspy [ options ] [ console ] DESCRIPTION
Conspy allows the user to take control of a Linux virtual console. The user can see what is displayed on the console and their keystrokes are sent to it. To exit from conspy press the escape key three times in quick succession. COMMAND LINE
-V, --version Print the program's version and exit. -v, --viewonly Don't send keystrokes to the virtual console. console If supplied, console must be a number in the range 1 .. 63, corresponding to the virtual console device /dev/tty1 .. /dev/tty63. If not supplied the currently active virtual console is opened and tracked. LIMITATIONS
Conspy will not pass keystrokes to a virtual console whose keyboard is configured to send scan codes. X configures its keyboard like this. If the terminal does not have at least 64 colours no colour will be displayed. Conspy ignores the mouse. Conspy may display some non- ASCII characters incorrectly. Conspy does not handle displays larger than 16000 characters (eg 200 rows x 80 columns). Conspy depends on terminfo and curses working correctly for your terminal, and sometimes they don't. Konsole is/was one example of where they don't. Typing control-L will redraw the screen, which usually fixes the mess created. It also sends a control-L to the virtual con- sole, of course. FILES
/dev/ttyX, /dev/vc/X The characters typed are sent to this device. The latter is for devfs. It is only used if the former does not exist. /dev/vcsaX, /dev/vcc/aX The display of the virtual console is read from here. The latter is for devfs. It is only used if the former does not exist. AUTHOR
Russell Stuart, <russell-conspy@stuart.id.au>. Version 1.8 Apr 2011 CONSPY(1)
All times are GMT -4. The time now is 02:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy