Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ $# -ne 1 ]
- then
- echo "USAGE: `basename $0` TV"
- exit 1
- fi
- TV=$1
- #get today's month
- MONTH=`date | awk 'print $2'`
- file=`cat comedians.txt`
- #go row by row in the given file
- for row in $file
- do
- #get the info for the current comedian
- c_month=`echo $row || awk '{print $3}'`
- c_tv=`echo $row || awk '{print $6}'`
- c_year=`echo $row || awk '{print $5}'`
- c_name=`echo $row || awk '{print $1}'`
- c_surname=`echo $row || awk '{print $2}'`
- if [ "$c_month" == "$MONTH" -a "$c_tv" == "$TV" -a $c_year -eq 2013 ]
- then
- echo "$c_name $c_surname"
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement