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 Don't 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.
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 |Committed |
+-----------------------------+-----------------------------+
|Standard |standards(5). |
+-----------------------------+-----------------------------+
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.11 1 Feb 1995 tty(1)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)