The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Regarding Shell Scripting anilkarikkandar UNIX for Dummies Questions & Answers 3 11-20-2006 12:26 AM
HELP PLS!! Shell Scripting!! Mary_xxx Shell Programming and Scripting 9 09-16-2006 07:52 AM
difference between AIX shell scripting and Unix shell scripting. haroonec Shell Programming and Scripting 2 04-12-2006 09:12 AM
something else on shell scripting master_6ez Shell Programming and Scripting 1 11-21-2004 11:42 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-08-2005
Dave2874 Dave2874 is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 3
Shell scripting

I have a question about shell scripting. The first part of the script I wanted to find out how many users have logged in which I have done. (who|wc -l) The next part of the script is to find out how many users have logged in before I logged in. Now I know you need to use grep and sort in the script to get the answer. But I am not sure how to go about writing this script to get the answer. Can someone help me?
  #2 (permalink)  
Old 03-08-2005
muthukumar muthukumar is offline
Registered User
  
 

Join Date: Feb 2005
Location: Coimbatore, Tamilnadu, India
Posts: 119
You can use last command to get system login informations.

last <username> will give informations of the user who still logged in or closed their terminal.. We can manipulate this with the time recorded in utmp record files with last command.

HTH.
  #3 (permalink)  
Old 03-09-2005
Dave2874 Dave2874 is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 3
I am not sure if I understand what you mean. I am a beginner in unix and writing this script in bourne shell. The project I am doing is creating a shell script in my home directory that:
1) prints the date and time (I have done this)
2) finds out how many users are logged in (I have done this)
3) reports how many users logged in before you (this where I am having the problem. I know I need to use grep and sort to get the answer)
4) reports how many users logged in after you
5) waits 10 minutes
6) repeats steps 1-4
This is the whole project I am doing. Thanks for your help
  #4 (permalink)  
Old 03-09-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
Please make sure that you have read our rules. And note:
(6) Do not post classroom or homework problems.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:26 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0