Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Write terminal contents into a one file in UNIX Post 302848627 by Lem on Thursday 29th of August 2013 04:02:20 PM
Old 08-29-2013
Quote:
Originally Posted by kiran425
Hi guys,

How to write terminal contents into a file in Unix operating system
Maybe you could give a look to:
Code:
man script

and/or
Code:
man tee

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

connecting to unix through hyper terminal - as a dumb terminal

I just changed from windows NT to XP and I am no longer able to connect to my unix system. I used to use hyper terminal -- which acts as dumb terminal to my main frame unix system. I think one of the options used to be "direct to comX". This option isn't listed now. I use a serial port and the... (2 Replies)
Discussion started by: michelle
2 Replies

2. Programming

How to read and write directory or file contents in c++ ?

Dear Friends, I m beginner unix programmer. I want to know, how to read and write directory or file contents in c++ ? (3 Replies)
Discussion started by: namrata5
3 Replies

3. UNIX for Dummies Questions & Answers

Deleting contents of a UNIX File

Hi ALL, Can anyone help me out. I have unix file, I need to delete the contents of the file. Can any one let me know the command to do this. The file has to be there, but the contents should be deleted. thanks Manas (6 Replies)
Discussion started by: manas6
6 Replies

4. HP-UX

how to redirect the growing contents of log file to another file in unix

how to redirect the growing contents of log file to another file in unix (2 Replies)
Discussion started by: megh
2 Replies

5. Shell Programming and Scripting

Remove spaces from first field, and write entire contents into other text file

Hi all, I have searched and found various threads about removing spaces from a field within a text file. Unfortunately, I have not found exactly what I'm looking for, nor am I adept enough to modify what I've found into what I need. I use the following command to remove the first line... (3 Replies)
Discussion started by: carriehoff
3 Replies

6. Shell Programming and Scripting

Need to write a script to reformat a file in unix but not familiar with unix

unix script must do the fiollowing open a file containing comma delimited records > each record contains 10 fields > removes the 2nd field and use that same field containing fields 2 to 10 the original record after fprocessing should containing fields 1 and 3 a new erecord must be... (10 Replies)
Discussion started by: dwightja
10 Replies

7. UNIX for Dummies Questions & Answers

How to add/sum same contents in a unix file

Input 1 2N 2N 1 2N 2N 1 2N 2N 1 2N Ateus 1 3 Mobiles 3M-100 1 3 Mobiles 3M-100 1 3 Mobiles 3M-100 1 3GNET 3gnet 1 3GNET 3gnet 1 3GNET G2828 1 3GNET G2828 1 3GNET G2829 1 3GNET G2829 1 3GNET G2829 OutPut should be 3 2N 2N 3 3 Mobiles 3M-100 2 3GNET 3gnet (4 Replies)
Discussion started by: gagan2010
4 Replies

8. Shell Programming and Scripting

Write array contents to file

Hi, I have a bash script that currently holds some data. I am trying to write all the contents to a file called temp.txt. I am using echo ${array} > temp.txt The problem that I am experiencing is that the elements are being written horizontally in the file. I want them written... (5 Replies)
Discussion started by: Filter500
5 Replies

9. UNIX for Dummies Questions & Answers

Trying To Write File Contents To Specfic .csv Cell

Hi, I'm attempting to write the entire contents of a file to a specific .csv cell. So far have only a nawk one liner that will write a value into a specific .csv cell. Trying to use man page but can't seem to get any farther. Any help would be appreciated. nawk -v r=2 -v c=3 -v val=5 -F,... (7 Replies)
Discussion started by: jimmyf
7 Replies

10. UNIX for Beginners Questions & Answers

UNIX utility to find difference in folder, file and contents of file against a base version

Hi, I am trying to find out whether there are any Unix utilities that compares folders, files and contents within the file and provides a comprehensive report. The comparison can be against base version of a folder and file with content. Can you please let me know of such a utility? Thanks,... (6 Replies)
Discussion started by: Sripathi_ks
6 Replies
tty(1)							      General Commands Manual							    tty(1)

NAME
tty - Returns pathname of terminal device SYNOPSIS
tty [-s] The tty command writes the full pathname of your terminal device to standard output. The tty command may also be used to determine if standard input is a terminal. STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: tty: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
Suppresses reporting the pathname. The XCU specification states that -s option is obsolete and recommends the portable applications use test -t 0 instead of tty -s. OPERANDS
None DESCRIPTION
The command tty -s evaluates as TRUE if standard input is a display and FALSE if it is not. [Tru64 UNIX] The file /dev/tty is a special file always refers to your controlling terminal, although it also may have another name like /dev/console or /dev/tty2. To avoid writing undesirable output to an output file--for example, to write a prompt in a shell script to the screen, while writing the response to the prompt to an output file--redirect standard output to /dev/tty. NOTES
While the -s option is useful if only the exit code is wanted, it does not rely on any ability to form a valid pathname. For a portable application you should use the command test -t 0. EXIT STATUS
The following exit values are returned: Successful completion. Standard input is not a display. [Tru64 UNIX] Invalid options specified. [Tru64 UNIX] An error occurred. DIAGNOSTICS
[Tru64 UNIX] Your standard input is not a display and you did not specify the -s option. EXAMPLES
To display full pathname of your terminal device, enter: tty To test whether or not the standard input is a terminal device, create a shell script containing the following: if tty -s then echo 'Output is a display' else echo 'Output is not a display' fi If the standard input is a terminal device, this displays the Output is a display message. If the standard input is not a terminal device, it displays the Output is not a display message. ENVIRONMENT VARIABLES
The following environment variables affect the execution of tty: Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari- ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the for- mat and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. FILES
Pseudodevice representing the user's controlling terminal. SEE ALSO
Commands: stty(1), test(1) Routines: ttyname(3) Files: tty(7) Standards: standards(5) tty(1)
All times are GMT -4. The time now is 01:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy