Period for which user is working on unix system


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Period for which user is working on unix system
# 1  
Old 10-07-2009
Period for which user is working on unix system

hello friends
i need a shell script which
will prompt to enter a user name
and displays , from how long he is using the system
# 2  
Old 10-07-2009
Hi friend.

Code:
read USER
last $USER | head -1


Last edited by Scott; 10-08-2009 at 05:00 AM..
# 3  
Old 10-07-2009
Quote:
Originally Posted by rammohan04
and displays , from how long he is using the system
This is date and time calculation(search the forum for solutions), the solution depend on your shell/OS.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Migrating jobs from COBOL Mainframe system to UNIX system

In a nutshell requirement is to migrate the system from mainframe environment to UNIX environment (MF cobol would be used I guess). I have not much of idea in this field. I need to do some investigation on following points - - Ease of conversion - Known Data compatibility issue - Issue in... (9 Replies)
Discussion started by: Tjsureboy4me
9 Replies

2. Shell Programming and Scripting

How to enforce user to Enter text when login to a UNIX / Linux system?

Hi. I inject my tracklogin.sh script in the profile of each user. $ more .profile ./tracklogin.sh # This is the default standard profile provided to a user. MAIL=/usr/mail/${LOGNAME:?} bash-3.2$ more tracklogin.sh #!/bin/bash tdate=$(date +"%d%m%y") mkdir -p /tmp/root_log... (20 Replies)
Discussion started by: mohtashims
20 Replies

3. Solaris

Cant understand the File system working nature

Hi, We have a filesystem whose usage has gone above 81%, i tried to zip some files in the sub directories but the space is not released in the main file system. > df -h Filesystem size used avail capacity Mounted on /u01/app 5.8G 4.6G 1.2G 81% ... (2 Replies)
Discussion started by: nokiak810
2 Replies

4. UNIX for Dummies Questions & Answers

Unix System Programmer Vs. Unix System Administrator

Hi friends, I hope you are all fine and doing well. First of all, let me say that I love Unix with passion. But I have one query in my mind that is bothering me. What should I do, Unix System Administration or Unix System Programmering. Could you please tell me the difference between the two. And... (3 Replies)
Discussion started by: gabam
3 Replies

5. Shell Programming and Scripting

awk - System command not working

dear All, my awk system command isn't working or rather I'm missing something in my command. Appreciated , if anyone can assist me what exactly I'm missing ?? awk ' /^/ { > c=split($3,a,"/") ;for(n=1; n<=c; ++n) > { > if (system("test -d" /home/cubedata/20120104/"$1"/"a")) { > print... (5 Replies)
Discussion started by: manas_ranjan
5 Replies

6. AIX

su to another user is not working

AIX Guys We are in AIX 5.3 We have two users in server User1 and User2 We'll login into user1 when we try su - User2 we'll get the following error Getting this error 3004-501 Cannot su to "User2" : Authentication is denied. su is allowed in the profile of the both users but... (1 Reply)
Discussion started by: ITHelper
1 Replies

7. Shell Programming and Scripting

awk system() command not working

I am using Sun Solaris 5.8 I am trying to run a system command such as ls and echo inside awk, but when I run the following code system echo is not displayed. bash-2.03$ ls | awk 'BEGIN { print "first print" system("echo system echo") print "second print" ... (1 Reply)
Discussion started by: rakeshou
1 Replies

8. Shell Programming and Scripting

UNIX Shell script to chec timeout period when collecting files in directory - HELP

Hi, I have a shell script which is to perform a check if all 4 particular type of files exists in a directory. If ALL 4 files are present within a specific Timeframe, then tar these files and zip it. If not all 4 files are present in the directory after the specific timeframe, then tar... (1 Reply)
Discussion started by: Danny Fang
1 Replies

9. UNIX for Dummies Questions & Answers

Limit number of user accessing to SCO UNIX System

Hi, In my company, we are using SCO UNIX system and Informix database. Recently, there have been a lot of users accessing to server and sometimes it has made server run very slow. So, I intend to limit number of users of 30 only. Although I have tried to search on the Internet for several days,... (1 Reply)
Discussion started by: trinhnguyen
1 Replies

10. UNIX for Dummies Questions & Answers

links working system wide

I have created symbolic links to several frequently used commands, for example: "lt" is a link to "ls -ltrgo|tail". What can I do to make these links available system-wide, or at least in the directories my coworkers are in most of the time? I have copied the link to several directories, and... (6 Replies)
Discussion started by: jpprial
6 Replies
Login or Register to Ask a Question