#!/bin/sh -u # Demonstrate data manipulation using Unix pipes # ------------------------------------------------------------------ # Syntax: $0 (no arguments) # ------------------------------------------------------------------ # Purpose: # Demonstrate data manipulation using Unix pipes: # - translate the date to upper-case # - extract the current time # - count the logged-in userids # - checksum part of the password file # - locate "reboot" lines # - display the most frequent logins # # ------------------------------------------------------------------ # # Comment: This file is missing its required comments. # ------------------------------------------------------------------ # PATH=/bin:/usr/bin ; export PATH umask 022 LC_COLLATE=C ; export LC_COLLATE pwd date | tr 'a-z' 'A-Z' date | awk '{print $4}' who | wc -l sort /etc/passwd | tail -5 | sum last | grep reboot last -a | grep -v reboot | awk '{print $10}' | sort \ | uniq -c | sort -nr | head -20