#!/bin/bash # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Copyright (c) 2010 FSOCA final project | http://joaosantacruz.com # This script is licensed under GNU GPL version 2.0 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Create an AWK file (awk-usage.awk) that searches through the same file as the sed # example that prints out any line that contains the word RECIPIENT, SENDER, # RECIPIENTemail or SENDERemail and outputs those lines to the screen. Extension: Create # a BASH script that calls the awk file and passes the filename to awk. # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - clear echo "= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =" echo " AWK Usage " echo "= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =" echo "" if [[ $1 && -f $1 ]] then #awk '/ RECIPIENT / {print}' < $1 #awk '/ SENDER / {print}' < $1 #awk '/RECIPIENTemail/ {print}' < $1 #awk '/SENDERemail/ {print}' < $1 awk -f awk-usage.awk $1 else echo -e "\nInvalid parameter/filename!\n" fi echo "" echo "= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =" echo "Press [enter] key to continue. . ."; read pressedKey