The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
Beginner Help Farhan082 UNIX for Dummies Questions & Answers 5 01-21-2009 07:33 PM
Beginner needs help with script martyb555 Shell Programming and Scripting 2 02-16-2008 01:24 PM
Please help. I am a beginner. Lykathea Aflame Shell Programming and Scripting 1 04-26-2006 02:46 AM
Shell Script for Beginner aaron_fong Shell Programming and Scripting 3 07-18-2005 03:24 AM
Beginner trying to write a shell script! duncan_glover Shell Programming and Scripting 3 08-19-2002 11:58 AM

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 05-27-2009
DethbyNo DethbyNo is offline
Banned
  
 

Join Date: May 2009
Posts: 2
Need help with (beginner?) script

I am in an intro to unix/linux course, and need some help with a project. We are tasked with creating a basic script to automate a task that an Admin might need to do. We submitted ideas and mine was to have the system keep a record of log in and log out times for users. I thought this was going to be easy, it seemed like it, but the teacher said if I could pull it off I would get an automatic A and he was anxious to see how I do it. Now I'm worried I bit off a bigger chunk then was expected of me. If I change scripts now I will automatically lose points. I'm not asking for the script to be written for me, not only would I not learn anything but I need to give a description of each line of code and what it does. So really I'm asking if any of you Linux pros, I know you're out there, would either kind of walk me through it or at least send me to the right spot to learn this. My book for the class is for absolute beginners and I'm unable to locate the information necessary to really even begin this task. Any help would be very much appreciated. Even if you can't help thanks for taking the time to read the post.
Bits Awarded / Charged to DethbyNo for this Post
Date User Comment Amount
05-27-2009 Neo Google is Your Friend. -5,610
  #2 (permalink)  
Old 05-27-2009
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,575
No homework please, the rules are quite clear and we do not want to be mentionned as "Contract Cheating" site, on the other side we do understand your misfortune, you are the one who will have to show us you work and we will try to guide you or explain your mistakes but do not expect the work be done for you.
That said, lets see what you are up to:
Log when users connect/disconnect can be quite easy but it all depends how the person connects, I usually add a few lines in /etc/profile for that...
Now what about if the user uses ftp, does that count?
and if he connects using remote shell (and so bypasses .profile...)

Good luck
  #3 (permalink)  
Old 05-27-2009
Neo's Avatar
Neo Neo is offline Forum Staff  
Administrator
  
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 6,727
On Linux, connecting accounting is managed through the following utilities:
  • dump-utmp : Converts raw data from /var/run/utmp or /var/log/wtmp into readable ASCII text. Hint: Good for scripting.
  • ac : Reads /var/log/utmp and outputs user connect time in hours.
  • last :Shows a list of last logged-in hours. More detail than ac.
  • who : Shows currently logged-in users. Reads from /var/log/utmp file.
  • utmp : Logs active user sessions.
  • wtmp : Records login and logout activity. Also records system reboots and run-level changes.

So, you can easily get the source code and finish your project in a few days.

Frankly speaking, I don't understand why a student posts such a question here, because you can easily get enough answers and code to move this project forward very fast with a simple Google search.

I am closing this thread after my post. You have more than enough info to move your project forward in this post.

Learn to use Google, that is my advice! All you have done, by posting this question, is to get someone (me) to Google for you. You should be ashamed of yourself. What kind of students can't do simple key word searches using Google??

  #4 (permalink)  
Old 05-27-2009
DethbyNo DethbyNo is offline
Banned
  
 

Join Date: May 2009
Posts: 2
Whoa

Neo: Post Deleted. User Banned for Multiple Rule Violations.

IP Address Banned.

Never argue with and insult moderators and admins about their decisions, especially when violating homework rules.
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 09:51 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