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
__gnu_pbds::detail::binary_heap_point_const_iterator___gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc >(3)

NAME
__gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc > - SYNOPSIS
Inherited by __gnu_pbds::detail::binary_heap_const_iterator_< Value_Type, Entry, Simple, _Alloc >. Public Types typedef _Alloc::template rebind< value_type > ::other::const_pointer const_pointer" typedef _Alloc::template rebind< value_type > ::other::const_reference const_reference" typedef trivial_iterator_difference_type difference_type" typedef trivial_iterator_tag iterator_category typedef _Alloc::template rebind< value_type > ::other::pointer pointer" typedef _Alloc::template rebind< value_type > ::other::reference reference" typedef Value_Type value_type Public Member Functions binary_heap_point_const_iterator_ (entry_pointer p_e) binary_heap_point_const_iterator_ () binary_heap_point_const_iterator_ (const binary_heap_point_const_iterator_ &other) bool operator!= (const binary_heap_point_const_iterator_ &other) const const_reference operator* () const const_pointer operator-> () const bool operator== (const binary_heap_point_const_iterator_ &other) const Public Attributes entry_pointer m_p_e Protected Types typedef _Alloc::template rebind< Entry > ::other::pointer entry_pointer" Detailed Description template<typename Value_Type, typename Entry, bool Simple, typename _Alloc>class __gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc > Const point-type iterator. Definition at line 55 of file binary_heap_/point_const_iterator.hpp. Member Typedef Documentation template<typename Value_Type , typename Entry , bool Simple, typename _Alloc > typedef _Alloc::template rebind<value_type>::other::const_pointer __gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc >::const_pointer Iterator's const pointer type. Definition at line 77 of file binary_heap_/point_const_iterator.hpp. template<typename Value_Type , typename Entry , bool Simple, typename _Alloc > typedef _Alloc::template rebind<value_type>::other::const_reference __gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc >::const_reference Iterator's const reference type. Definition at line 87 of file binary_heap_/point_const_iterator.hpp. template<typename Value_Type , typename Entry , bool Simple, typename _Alloc > typedef trivial_iterator_difference_type __gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc >::difference_type Difference type. Definition at line 65 of file binary_heap_/point_const_iterator.hpp. template<typename Value_Type , typename Entry , bool Simple, typename _Alloc > typedef trivial_iterator_tag __gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc >::iterator_category Category. Definition at line 62 of file binary_heap_/point_const_iterator.hpp. template<typename Value_Type , typename Entry , bool Simple, typename _Alloc > typedef _Alloc::template rebind<value_type>::other::pointer __gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc >::pointer Iterator's pointer type. Definition at line 72 of file binary_heap_/point_const_iterator.hpp. template<typename Value_Type , typename Entry , bool Simple, typename _Alloc > typedef _Alloc::template rebind<value_type>::other::reference __gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc >::reference Iterator's reference type. Definition at line 82 of file binary_heap_/point_const_iterator.hpp. template<typename Value_Type , typename Entry , bool Simple, typename _Alloc > typedef Value_Type __gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc >::value_type Iterator's value type. Definition at line 68 of file binary_heap_/point_const_iterator.hpp. Constructor &; Destructor Documentation template<typename Value_Type , typename Entry , bool Simple, typename _Alloc > __gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc >::binary_heap_point_const_iterator_ () [inline] Default constructor. Definition at line 95 of file binary_heap_/point_const_iterator.hpp. template<typename Value_Type , typename Entry , bool Simple, typename _Alloc > __gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc >::binary_heap_point_const_iterator_ (const binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc > &other) [inline] Copy constructor. Definition at line 99 of file binary_heap_/point_const_iterator.hpp. Member Function Documentation template<typename Value_Type , typename Entry , bool Simple, typename _Alloc > bool __gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc >::operator!= (const binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc > &other) const [inline] Compares content (negatively) to a different iterator object. Definition at line 126 of file binary_heap_/point_const_iterator.hpp. template<typename Value_Type , typename Entry , bool Simple, typename _Alloc > const_reference __gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc >::operator* () const [inline] Access. Definition at line 113 of file binary_heap_/point_const_iterator.hpp. template<typename Value_Type , typename Entry , bool Simple, typename _Alloc > const_pointer __gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc >::operator-> () const [inline] Access. Definition at line 105 of file binary_heap_/point_const_iterator.hpp. template<typename Value_Type , typename Entry , bool Simple, typename _Alloc > bool __gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc >::operator== (const binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc > &other) const [inline] Compares content to a different iterator object. Definition at line 121 of file binary_heap_/point_const_iterator.hpp. Author Generated automatically by Doxygen for libstdc++ from the source code. libstdc++ __gnu_pbds::detail::binary_heap_point_const_iterator_< Value_Type, Entry, Simple, _Alloc >(3)
All times are GMT -4. The time now is 10:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy