09-30-2002
Script to count unique number of user loged in
Hi all, I am taking my first course in unix and having some problems.
I would line to create a scrip that does the following:
1) will tell me the number of users logged in. If a user is logged more than once just count it only ones.
2) want to be able to display the number of users that logged before me.
3) want to be able to display the number of user that logged after me.
4) run this process every 30 minutes.
Please help.
Peter Fana
10 More Discussions You Might Find Interesting
1. Post Here to Contact Site Administrators and Moderators
hi
i am a student, i want to know how to display the users who loged in before 5 minutes, in uinx
pls reply me immediately (0 Replies)
Discussion started by: roshni
0 Replies
2. Shell Programming and Scripting
:confused: Hi
i am trying to make a script through which i can get the total number of User and their PID after that kill all Users except the one by which i am currently logged in. (i m using SCO UNIX 5.06)
# id of current usre < total number of current user
USR=`who -u |wc -l`
# id of... (2 Replies)
Discussion started by: aafflatoon
2 Replies
3. Shell Programming and Scripting
hello everyone,
I'm trying to learn some scripts but i cant get my head around two of them.
1. how can i write a script that will count the number of times a particular word is used in file?
2. how can i make a script that will take me to a web page from unix?
if anyone could help it... (3 Replies)
Discussion started by: BigTool4u2
3 Replies
4. UNIX for Advanced & Expert Users
Hello Everyone
I need your help in fixing this issue., I have a log file which has data of users logging in to an application.
I want to search for a particular pattern in the log
ISSessionValidated=N
If this key word is found , the above 8 lines will contain the name of the user who's... (12 Replies)
Discussion started by: xtechkid
12 Replies
5. Shell Programming and Scripting
HI All,
I have a CSV file of 30 columns separated by ,. I want to get a count of all unique rows written to a flat file. The CSV file is around 5000 rows
The first column is a time stamp and I need to exclude while counting unique
Thanks,
Ravi (4 Replies)
Discussion started by: Nani369
4 Replies
6. Shell Programming and Scripting
Hi
I have a file with number of entries
name 1 123
name 1 345
name 1 65346
name2 3243
name2 24234
name 2 234234
so on .........
how to count total number of entries for name 1 and name2...and so on Please guide. (1 Reply)
Discussion started by: manigrover
1 Replies
7. Shell Programming and Scripting
Hi All!
I would like to have a script that will count the number of files at the top of the hour of soome directories and mail the results to me.
I was thinking on :
a=`/directory/subdirectory/ | wc -l`
echo "/directory/subdirectory :$a"
b=`/another_dir/subdir/ | wc -l`
echo... (12 Replies)
Discussion started by: fretagi
12 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I need a solaris shell script to read multiple files and count number of unique name rows(strings) from those files. The input and output should be like this
Input:
file 1
abc
cde
abc ... (9 Replies)
Discussion started by: ssk250
9 Replies
9. Shell Programming and Scripting
What is an efficient way of counting the number of unique values in a 400 column by 1000 row array and outputting the counts per column, assuming the unique values in the array are:
A, B, C, D
In other words the output should look like: Value COL1 COL2 COL3
A 50 51 52... (16 Replies)
Discussion started by: Geneanalyst
16 Replies
10. UNIX for Beginners Questions & Answers
Hello All,
I am looking to write a script to count the number of a term and its opposite and create a new file with said list. I can get the terms to print to the file but only one or the other and not both.
I tried this:
grep -wi done */all.txt | grep -wiv done */all.txt > "filename"
... (5 Replies)
Discussion started by: mcesmcsc
5 Replies
uptime(1) General Commands Manual uptime(1)
NAME
uptime, w - show how long system has been up and/or who is logged in and what they are doing
SYNOPSIS
[user]
[pset_list]]
[user]
[pset_list]]
DESCRIPTION
prints the current time, the length of time the system has been up, the number of users logged on to the system, and the average number of
jobs in the run queue over the last 1, 5, and 15 minutes for the active processors.
is linked to and prints the same output as displaying a summary of the current activity on the system.
Options
and recognize the following options:
Print the current time, the length of time the system has been up,
and the number of users logged on to the system in the first line of the output. The average number of jobs in the core over
the last 1, 5, and 15 minutes for the active processors is also printed.
When used with the option, the load averages for the processor sets (psets) are calculated on a core basis.
Suppress the first line and the heading line.
This option should not be used with the option. This option assumes the use of the option to
Use long output.
This option assumes the use of the option to
Print the current time, the length of time the system has been up, and
the number of users logged on to the system in the first line of the output. The load averages over the last 1, 5, and 15
minutes for the processor sets (psets) given in the command line, pset_list, are displayed in the subsequent lines. If no
arguments are given, the load averages are displayed for all the psets in the system.
If pset id of an empty pset is given in the command line, a corresponding message will be displayed. If the kernel does not
have the pset capability, gives an error. The option cannot be used along with other options except
Use the short form of output for displaying terminal information.
The terminal name is abbreviated, and the login time and CPU times are suppressed.
Print only the first line describing the overall state of the system.
This is the default for the command.
Print a summary of the current activity on the system for each user.
This is the default for the command.
EXAMPLES
The command:
produces text resembling the following:
depending upon the current status of the system.
The command:
gives the load average of all the psets in the system. If 0, 94, 95, and 97 are existing psets in the system, the output will look like
the following:
The command:
gives output which looks like the following if 94 and 95 are valid pset ids:
The command:
gives the load average of the system, producing output resembling the following:
The command:
gives the load average of all the psets in the system. If 0 and 1 are psets in the system, the output will look like the following:
AUTHOR
was developed by the University of California, Berkeley and HP.
SEE ALSO
mpctl(2), pset_ctl(2).
uptime(1)