Shell program for beginners


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell program for beginners
# 1  
Old 05-23-2011
Shell program for beginners

Hey, i hope someone can help me with this program.

I need to write a program in shell which will return how many times and how much time have users been logged in system between two dates. We give time as 2 dates as arguments in command line.
Example:

$ nameofprogram 27/04 06/05

returns this:

user1 2x 0 days 2:46
user2 4x 0 days 11:42
user3 2x 0 days 1:58
user4 3x 1 day 18:41

As i find it really hard to programm in shell, i hope someone can help me with this. Thanks
# 2  
Old 05-23-2011
This won't be a straight forward task as far as I know. First you need to capture the user log in a text file with time stamp.

I think who -u can be used to capture the info at regular intervals. But i'm not sure is there a way which automatically creates an entry in log.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Which Linux Certification comes first for beginners?

I want to get a Linux Certification to start my Career in IT sector. My Qualification is MCS from a top university. Suggest me some Linux Certifications. (1 Reply)
Discussion started by: alexwatson1711
1 Replies

2. UNIX for Beginners Questions & Answers

Clustering for beginners. Few questions.

Hello! I need some advices from You. How many days i need to setup cluster using virtual box for mid exp user? Do you have any ideas related to master thesis related to clustering? I need to include some search aspect within that topic.Can You recommend some books/docs about that case? Thank... (4 Replies)
Discussion started by: protos27
4 Replies

3. UNIX for Dummies Questions & Answers

UNIX ebook for beginners

hi all, Can you suggest me a ebook for unix beginners. I am new to unix. (2 Replies)
Discussion started by: rajasingam
2 Replies

4. OS X (Apple)

A simple reminder script for beginners to shell scripting.

(Apologies for any typos.) Well hands up those who have been in the following situation(s):- Your partner, (in my case the missus), sees that you are messing with your machine and says something like, "can you keep an eye on the dinner, I am going out shopping", and you look up glazed eyed... (3 Replies)
Discussion started by: wisecracker
3 Replies

5. UNIX for Dummies Questions & Answers

UNIX for beginners

i'm just a beginner in unix environment- please help which book to read and which os to use!!! :confused: seriously i've no idea what is unix or how much capable it is!! (1 Reply)
Discussion started by: gaurav singh
1 Replies

6. Shell Programming and Scripting

awk beginners question

hi, i start using awk and have a very basic problem. here's my code: #! /usr/bin/awk -f # 2010, scz # { $1 == "test" { print $2 } } this works on the command line but not as "program" - what is the difference between awk programs on the command line and executing awk... (3 Replies)
Discussion started by: svencz
3 Replies

7. UNIX Desktop Questions & Answers

UNIX for beginners

I am new to non Windows operating systems. Does anyone have advice on which UNIX OS vendor would be good for learning purposes. I was looking for a version of UNIX that runs on the Intel platform. Do you have any recommendations on where to purchase the software? Thank you. (14 Replies)
Discussion started by: jmy113437
14 Replies

8. UNIX Desktop Questions & Answers

unix course for beginners

does anyone know of a course for unix beginners (1 Reply)
Discussion started by: moose
1 Replies

9. Programming

X-programming for beginners

Good morning. Thanks for the very valuable hard-to-find information I get from you guys. Can anybody give any suggested websites or references for anyone who wants to begin learning on programming applications in X? Thanks to anyone in advance... (1 Reply)
Discussion started by: jfsuminist
1 Replies
Login or Register to Ask a Question