Sponsored Content
Homework and Emergencies Homework & Coursework Questions Simple loop to mail all active users. Post 302985344 by kjcraig77 on Tuesday 8th of November 2016 11:28:14 AM
Old 11-08-2016
Simple loop to mail all active users.

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data:
Send a fortune to all active/logged in users

2. Relevant commands, code, scripts, algorithms:
So I understand I need to use the who command to see all the active users online. Then mail those users a fortune using the built in fortune command. The issue I'm having is how I would put this into a for loop?
Do I simply create a log of all active users and awk that? I'm sorry I am having a really hard time with shell scripting and cant grasp my head around the logic behind this simple one line of code.


3. The attempts at a solution (include all code and scripts):



4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Modesto Junior College, Modesto (CA), US, Dale Phillips, and CMSCI-210:

Thank you for the help. I know theres not to much information but thats why im here Smilie. Try and get a push in the right direction.

Last edited by rbatte1; 11-08-2016 at 12:38 PM.. Reason: Retro-fitted the template so that this makes sense.
 

4 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Active / Non Active users ?

Hey, I have few Questions : 1. How to Check/Find who all are the users accessing the server using their id ? 2. How to Check who is the active user or non active user (whose id exists but the access privileges has been removed) ? I am presently using AIX5.3 as a server. Please suggest... (3 Replies)
Discussion started by: varungupta
3 Replies

2. Linux

Command for list of active/disabled users

Hi, I want to know the command for finding out the list of active/disabled users in Linux System. Model:x86_64. Rev:2.6.9 Thanks in advance for your help Mike (1 Reply)
Discussion started by: Mike1234
1 Replies

3. UNIX for Dummies Questions & Answers

control permissions for Active Directory users on AIX

Hello, I've configured an user authentication against Active Directory (Windows Server 2008 R2) on AIX V6 with LDAP. It works fine. And here's my problem: How can I control ldap user permissions on the local AIX machine? E.g. an AD user should be able to write all files of local sys... (1 Reply)
Discussion started by: xia777
1 Replies

4. AIX

Authenticate AIX users from MS Active Directory

First, let me start off saying this is not spam. This is me trying to help out other AIX Admins with MS AD servers. If it is not applicable to you, someone else will find it useful. As long as the "KDC" service is running on your AD server, these steps should work. There should be no... (3 Replies)
Discussion started by: kah00na
3 Replies
Module::Starter::Plugin::Template(3pm)			User Contributed Perl Documentation		    Module::Starter::Plugin::Template(3pm)

NAME
Module::Starter::Plugin::Template - module starter with templates VERSION
Version 1.58 SYNOPSIS
use Module::Starter qw( Module::Starter::Simple Module::Starter::Plugin::Template ); Module::Starter->create_distro(%args); DESCRIPTION
This plugin is designed to be added to a Module::Starter::Simple-compatible Module::Starter class. It adds stub methods for template retrieval and rendering, and it replaces all of Simple's _guts methods with methods that will retrieve and render the apropriate templates. CLASS METHODS
"new(%args)" This plugin calls the "new" supermethod and then initializes the template store and renderer. (See "templates" and "renderer" below.) OBJECT METHODS
"templates()" This method is used to initialize the template store on the Module::Starter object. It returns a hash of templates; each key is a filename and each value is the body of the template. The filename Module.pm is used for the module template. "renderer()" This method is used to initialize the template renderer. Its result is stored in the object's "renderer" entry. The implementation will determine its use. "render($template, \%options)" The "render" method will render the template passed to it, using the data in the Module::Starter object and in the hash of passed parameters. _guts methods All of the "FILE_guts" methods from Module::Starter::Simple are subclassed to look something like this: sub file_guts { my $self = shift; my %options; @options{qw(first second third)} = @_; my $template = $self->{templates}{filename}; $self->render($template, \%options); } These methods will need to be rewritten when (as is likely) Module::Starter::Simple's _guts methods are refactored into a registry. module_guts Makefile_PL_guts MI_Makefile_PL_guts Build_PL_guts Changes_guts README_guts t_guts MANIFEST_guts item ignores_guts AUTHOR
Ricardo SIGNES, "<rjbs at cpan.org>" Bugs Please report any bugs or feature requests to "bug-module-starter at rt.cpan.org", or through the web interface at <http://rt.cpan.org>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. COPYRIGHT
Copyright 2005-2007 Ricardo SIGNES, All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.12.4 2011-07-02 Module::Starter::Plugin::Template(3pm)
All times are GMT -4. The time now is 07:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy