Sponsored Content
Operating Systems Solaris How to say goodbye to a fellow admin via Shell script.? Post 302970461 by os2mac on Wednesday 6th of April 2016 06:45:23 PM
Old 04-06-2016
He is world renowned for his terse emails:

My solution:

Greybeard,

WRT the old joke about replacing people with small shell scripts. I guess I'll have to implement this as a cron now:


"greybeard.sh" 8 lines, 505 characters
Code:
 
 #!/usr/bin/bash
 BE=`find_kernel_patchLVL2.sh|grep "active(yes"|awk -F- '{print $2}'|cut -c 1-2`
 ABE=`find_kernel_patchLVL2.sh|grep "active( no"|awk -F- '{print $2}'|cut -c 1-2`
 if [ "$ABE" -gt "$BE" ]
         then
         mailx -r greybeard@example.com -s "`hostname` is on the wrong boot environment" \
         unix@example.com<<<$'\n please reboot it to the correct BE, \ngratitude \
         \n\n None of us are as smart as all of us.\n Spam me, please\n'
 fi

 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

shell or admin fires the db

Q for the admin guys, When the server (Spark) is rebooted does a shell starts database, connection to database, and etc or would have to be the administrator log on as database admin and start the database? If it starts from the shell how would the script look like since the dba has access to the... (1 Reply)
Discussion started by: softarch
1 Replies

2. Shell Programming and Scripting

how to connect to admin accout through script

hi everyone i'm running script in c-shell and i want this script to connect to admin account in order to run other script in k-shell. after that i want the script to be severed from the admin account and to continue with the regular commands example: my script call cs-customers echo"starting... (16 Replies)
Discussion started by: naamas03
16 Replies

3. Shell Programming and Scripting

Script stops running the remaining checks after becoming admin

Hi all, I encountered a problem where my script stops running the remaining checks after becoming an admin that is written within the script. For example: ========================================= #!/bin/sh check 1 # Runs successfully check 2 # Runs successfully /com/bin/admin #... (1 Reply)
Discussion started by: seanchew
1 Replies

4. AIX

script for finding all the users with GID 0 ( admin group )

Hi Friends, I am trying to write a script for finding all the users with the GID 0 i.e. Admin users. can you please help me on this. (1 Reply)
Discussion started by: anoopraok
1 Replies

5. What is on Your Mind?

Windows Admin switching to *nix Admin

I'm currently a Windows admin and have wanted to jump ship to the *nix side for a while now. I've been studying both through an lpic level 1 manual as I have time (focusing on debian), and a solaris 10 cert book. The problem is I only have a handful of hours a week to study, and my current job... (3 Replies)
Discussion started by: bobwilson
3 Replies

6. Shell Programming and Scripting

Script to Send Email to a user when an admin kills process

Can anyone create or give me a script that I can use to email a user automatically when I kill one of their processes? Or Can you give me a script to allow me to email a user (entering email manually) when a process is killed? Like showing what the PID was and a reason the admin killed it? Is... (2 Replies)
Discussion started by: JoeGazz84
2 Replies

7. What is on Your Mind?

Regarding Admin life either as DBA or UNIX Linux admin

I am planning to choose my career as Unix/Linux Admin or a DBA. But I have come to know from forums and few admins like the job will be 24/7. I have few questions on that. Can we get "DAY" shifts in any one of the admin Job ? Can't we have shift timings in any company ? Eventhough the... (7 Replies)
Discussion started by: Jacktts
7 Replies
script(1)							   User Commands							 script(1)

NAME
script - make record of a terminal session SYNOPSIS
script [-a] [filename] DESCRIPTION
The script utility makes a record of everything printed on your screen. The record is written to filename. If no file name is given, the record is saved in the file typescript. See WARNINGS. The script command forks and creates a sub-shell, according to the value of $SHELL, and records the text from this session. The script ends when the forked shell exits or when Control-d is typed. OPTIONS
The following option is supported: -a Appends the session record to filename, rather than overwriting it. NOTES
script places everything that appears on the screen in filename, including prompts. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) WARNINGS
script can pose a security risk when used in directories that are writable by other users (for example, /tmp), especially when run by a privileged user, that is, root. Be sure that typescript is not a link before running script. SunOS 5.11 30 Jan 2004 script(1)
All times are GMT -4. The time now is 04:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy