03-18-2011
It would help if you post the tty command output (or $a value).
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I needed to write a script to "Collect and Display the Last User ID and Date of Last Login".
The requirement is:
When a workstation stops reporting it could be for many reasons. If we know the last person who logged in before the workstation came down, then we can contact the last... (1 Reply)
Discussion started by: amittal
1 Replies
2. Shell Programming and Scripting
Hi,
I needed to write a script to "Collect and Display the Last User ID and Date of Last Login".
The requirement is:
When a workstation stops reporting it could be for many reasons. If we know the last person who logged in before the workstation came down, then we can contact the last... (1 Reply)
Discussion started by: amittal
1 Replies
3. Shell Programming and Scripting
I know that in order to get a real user name I should use the following command: cut -d: -f5 /etc/passwd. But how can I get the real user name for those users who are currently logged in to the system??? :confused: Can somebody help me??? (3 Replies)
Discussion started by: aga
3 Replies
4. Shell Programming and Scripting
When I typed in ps -a I get this:
PID TTY TIME CMD
31799 pts/3 00:00:00 vim
31866 pts/3 00:00:00 vim
And to check who is currently logged in, I type who
Felix Whoals
Tada Whoals
Lala Whoals
How can I get the user process for all current users who logged in?? I think I need to combine... (14 Replies)
Discussion started by: felixwhoals
14 Replies
5. Shell Programming and Scripting
Is there a way to display the default answer when accepting input from the user in the unix script..
e.g.
ans="n"
read $ans?"Enter y to continue n to exit:"
altough ans contains n the message doesn't display the current contents on ans .. you get
Enter y to continue n to exit: (8 Replies)
Discussion started by: flopster
8 Replies
6. Shell Programming and Scripting
Write a tool that will be displayed in real time, what user connects or disconnects from a system that uses this tool :))
Maybe anyone can help me? (2 Replies)
Discussion started by: titasas
2 Replies
7. Shell Programming and Scripting
so i'm using the following script to attempt to simulate a user visiting a page but unfortunately, it doesn't look like this is working:
wget -nv -r "http://www.mywebsite.com"
does anyone have a better idea of how to do this? the goal here is to run a wget command from a linux host to a... (3 Replies)
Discussion started by: SkySmart
3 Replies
8. Shell Programming and Scripting
Hi all - I'm completely stumped by a script I'm working on...
The short version is I have a file called 'lookup' and in it are hundreds of names (first and last). I have a script that basically allows the user to enter a name, and what I need to have happen is something like this:
Record... (8 Replies)
Discussion started by: sabster
8 Replies
9. UNIX for Advanced & Expert Users
Hello All,
Was recently working on an requirement where we have to search files more than a specific number, following is the example on same.
Let's say file names are test_40000.txt,test_40001.txt and so on till test_99999.txt.
Now requirement was to search from find command only those... (1 Reply)
Discussion started by: RavinderSingh13
1 Replies
10. Programming
I figured it out by now. (0 Replies)
Discussion started by: Ralph
0 Replies
LEARN ABOUT OPENSOLARIS
tty
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)