tty Command Purpose Writes to standard output the full path name of your terminal. Syntax /usr/bin/tty [ -s ] Description The tty command writes the name of your terminal to standard out- put. If your standard input is not a terminal and you do not specify the -s flag, you get the message Standard input is not a tty. The following environment variables affect the execution of the tty command: LANG Determines the locale to use for the locale categories when neither the LC_ALL variable nor the corresponding environment variable beginning with LC_ specifies a locale. LC_ALL Determines the locale to be used. This variable overrides any values for locale categories that are specified by any other environment variable beginning with LC_ or by the LANG variable. LC_CTYPE Determines the locale for the interpretation of se- quences of bytes of text data as characters. For example, this variable may specify multi-byte characters instead of single-byte characters. LC_MESSAGES Determines the language for messages. Flags -s Suppresses reporting the path name. Exit Status This command returns the following exit values: 0 Standard input is a terminal 1 Standard input is not a terminal >1 An error occurred. Examples 1. To display the full path name of your display: tty 2. To test whether or not the standard input is a terminal: if tty -s then echo 'Enter the text to print:' >/dev/tty fi qprt If the standard input is a terminal, this displays the message "Enter the text to print:" as a prompt and prints the text that the user types. If the standard input is not a terminal, this displays nothing; it merely prints the text read from the stan- dard input. The echo . . . >/dev/tty displays the prompt on the screen even if you redirect the standard output of the shell procedure. This way the prompt is never written into an output file. The special file /dev/tty always refers to your terminal, although it also has another name such as /dev/console or /dev/tty2. Implementation Specifics This command is part of Base Operating System (BOS) Runtime. Files /usr/bin/tty Specifies the tty command. /dev/tty Specifies the tty pseudo device. Related Information The National Language Support Overview for Programming in AIX Version 3.2 General Programming Concepts discusses the LC_ vari- ables. tty Command for the Kernel Debug Program Purpose Displays the tty structure. Syntax tty [ [ a | o ] | [ v | Name ] [ Major [ Minor [ Channel ] ] ] ] Description The tty command displays tty data structures. If no parameters are specified, a verbose listing of all terminals is displayed. Short forms of the listings can be requested showing all termi- nals or all currently open terminals. Selected terminals can be displayed by specifying the terminal name, such as tty1, or a ma- jor device number with optional minor and channel numbers. If the Major parameter is specified, all terminals with the speci- fied major number are listed. If the Major and Minor parameters are both specified, all terminals with both the specified major and minor numbers are listed. Each tty data structure contains information such as the process group to which the terminal belongs, the channel that controls the terminal, the port status, buffer and queue pointers, and the line discipline. Note: Use the tty command only while running the kernel debug program. Flags a Displays a short listing of all terminals. o Displays a short listing of all open terminals. v Displays a verbose listing. Examples 1. To display listings for each open terminal, enter: tty 2. To display verbose listings for each open terminal with a ma- jor number 7, enter: tty v 7 3. To display the listing for the terminal with a major number 7 and a minor number 1, enter: tty 7 1 Related Information The Kernel Debug Program Overview in AIX Version 3.2 General Programming Concepts. Error Messages for the Kernel Debug Program in AIX Version 3.2 General Programming Concepts. List of Kernel Debug Program Commands in AIX Version 3.2 General Programming Concepts.