Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tty(1) [freebsd man page]

TTY(1)							    BSD General Commands Manual 						    TTY(1)

NAME
tty -- return user's terminal name SYNOPSIS
tty [-s] DESCRIPTION
The tty utility writes the name of the terminal attached to standard input to standard output. The name that is written is the string returned by ttyname(3). If the standard input is not a terminal, the message ``not a tty'' is written. The options are as follows: -s Do not write the terminal name; only the exit status is affected when this option is specified. The -s option is deprecated in favor of the ``test -t 0'' command. EXIT STATUS
The tty utility exits 0 if the standard input is a terminal, 1 if the standard input is not a terminal, and >1 if an error occurs. SEE ALSO
test(1), ttyname(3) STANDARDS
The tty utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible. HISTORY
A tty command appeared in Version 1 AT&T UNIX. BSD
June 6, 1993 BSD

Check Out this Related Man Page

tty(1)								   User Commands							    tty(1)

NAME
tty - return user's terminal name SYNOPSIS
tty [-l] [-s] DESCRIPTION
The tty utility writes to the standard output the name of the terminal that is open as standard input. The name that is used is equivalent to the string that would be returned by the ttyname(3C) function. OPTIONS
The following options are supported: -l Prints the synchronous line number to which the user's terminal is connected, if it is on an active synchronous line. -s Inhibits printing of the terminal path name, allowing one to test just the exit status. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of tty: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 Standard input is a terminal. 1 Standard input is not a terminal. >1 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |enabled | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
isatty(3C), ttyname(3C), attributes(5), environ(5), standards(5) DIAGNOSTICS
not on an active synchronous line The standard input is not a synchronous terminal and -l is specified. not a tty The standard input is not a terminal and -s is not specified. NOTES
The -s option is useful only if the exit status is wanted. It does not rely on the ability to form a valid path name. Portable applications should use test -t. SunOS 5.10 1 Feb 1995 tty(1)
Man Page

15 More Discussions You Might Find Interesting

1. Solaris

What is /dev/tty /dev/null and /dev/console

Hi, Anyone can help My solaris 8 system has the following /dev/null , /dev/tty and /dev/console All permission are lrwxrwxrwx Can this be change to a non-world write ?? any impact ?? (12 Replies)
Discussion started by: civic2005
12 Replies

2. UNIX for Advanced & Expert Users

Change putty title window?

Is it possible to change the putty window title from a Unix command line? (12 Replies)
Discussion started by: akbar
12 Replies

3. AIX

Question about Smitty Fs (backup an F.S)

hi all:cool: was just wonderin..by the way im new here..hi all:D...was just wonderin if i smitty fs backup a file system to tape if the permissions and ownership of the files and dir are retained?:confused: o.s is AIX 5.3L thanks all (12 Replies)
Discussion started by: redmanshogun
12 Replies

4. UNIX for Advanced & Expert Users

stty: error occurs when installing rpm

Hello All, when I install rpm rpm --install rpm packagename I got the following errors stty:standard input:invalid argument stty:standard input:invalid argument I dont know what i have to do exactly. I search on google for the same but not a particular standard solution is given... (17 Replies)
Discussion started by: amitpansuria
17 Replies

5. Shell Programming and Scripting

POSIX way of getting columns in tty?

Is there a POSIX compatible way of getting the number of columns in a tty? On Linux, I can do something like: stty -a | awk -F'' '/columns/ { print $9 }' But will that work on AIX, Solaris, etc? (13 Replies)
Discussion started by: otheus
13 Replies

6. UNIX for Dummies Questions & Answers

TTY Insane

Hi All, Long time reader, first time poster. I have a tip session to a v480 serial console running Solaris 9. Look at this mess I'm getting back... connected... (16 Replies)
Discussion started by: danny.hudson
16 Replies

7. AIX

Stty settings before login

Hello. I'm experiencing a frustrating issue. I'm using an old, unsupported terminal client (QVT) with AIX 6.1 using ssh2. I've come up with some stty settings that allow full usage of the system but to do so I've had to set "igncr". While this works fine once the user is logged in there are... (12 Replies)
Discussion started by: RedCabbage
12 Replies

8. Shell Programming and Scripting

Exits from putty instead of shell script

Dear, I have written below code to initiate the log at top of my script. #Set the log file LOGFILE=<path>/<filename.log> exec > $LOGFILE 2>&1 ............... .... ... .. ............ echo -e "\n\n Script finished OK " `date "+%m/%d/%y %H:%M:%S" ` "\n\n" exit 0 the logging ends only... (14 Replies)
Discussion started by: Imran_Chennai
14 Replies

9. AIX

Cannot create user using SMITTY

i'm using smitty to create user...what happen is it prompt me "failed" with error 3004-703 Check "/etc/security/login.cfg" file. 3004-691 Error changing "shell". 3004-703 Check "/usr/lib/security/mkuser.default" file. 3004-721 Could not create user. 3004-703 Check... (13 Replies)
Discussion started by: thecobra151
13 Replies

10. UNIX for Dummies Questions & Answers

Change putty title name

Hello all, I have a not so unix question for you guys(or maybe it is). I use PUTTY to login to serverA (my putty title shows as serverA.domainname.com) Now from ServerA i do ssh user@ServerB (i have ssh public private key setup)... now my question is when i do ssh and logon to... (20 Replies)
Discussion started by: abdul.irfan2
20 Replies

11. Shell Programming and Scripting

Stty: : No such device or address

hi, i am trying to execute a script through Cron, then everytime it is redirecting a message stty: : No such device or address Unmatched ` here is the cron entry: 35,40,45,50,55 04,05 07 08 * /uv1402/u207/home/bravodba/bestdbscript/shscriptfiles/bravo_main_refresh.sh while the script... (20 Replies)
Discussion started by: lovelysethii
20 Replies

12. Homework & Coursework Questions

Asst: Shell Script to sed

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Generalize your sub2 script, producing a new script sub3 that will apply a substitution to any number of files... (16 Replies)
Discussion started by: raymondbn
16 Replies

13. UNIX for Dummies Questions & Answers

Remove newlines

Hi buddy's my file are like this: s.no,name,band,sal 1,"suneel",,10 2,"bargav sand",,20 30," ebdug gil",,4 but i want s.no,name,band,sal 1,"suneel",,10 2,"bargav sand",,20 30,"ebdug gil",,4 any command or Shell script for this. please help me it's urgent to implement (33 Replies)
Discussion started by: Suneelbabu.etl
33 Replies

14. UNIX for Dummies Questions & Answers

Can we build a tool for Windows to retrieve data from UNIX servers (putty console)

Hi Friends, Is it possible to build a windows tool ( a java applet maybe? ) which can retrieve data and display after performing certain commands on unix servers ( simple grep / script output) after logging into putty console. I am on a company server so please bear that in mind. I might have... (23 Replies)
Discussion started by: srkmish
23 Replies

15. Shell Programming and Scripting

Automating pbrun /bin/su not working, whenever manually it is working using putty

I am trying to automate a script where I need to use pbrun /bin/su but for some reason it is not passing thru the pbrun as my code below. . ~/.bash_profile pbrun /bin/su - content c h 1 hpsvn up file path I am executing this from an external .sh file that is pointing to this scripts file... (14 Replies)
Discussion started by: jorgejac
14 Replies