I got 99 problems but a bitch ain’t one!
August 23rd, 2007#!/bin/bash
if [ -f girlproblems.txt ]
then
FEELINGS=”bad”
PROBLEMS=`cat myproblems.txt | wc -l`
if [ $PROBLEMS == "99" ]
then
BITCHES=`cat myproblems.txt | grep bitch | wc -l`
if [ $BITCHES == "0" ]
then
echo “a bitch ain’t one!”
fi
fi
fi
Too many glasses of scotch will do that to you.
This entry was posted on Thursday, August 23rd, 2007 at 7:30 pm and is filed under Bash, Linux, Random, Shell. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
April 2nd, 2008 at 8:30 am
Useless use of cat.
April 6th, 2008 at 4:50 pm
Well, I did spend too little time and too much scotch on this. Of course
grep bitch myproblems.txtis a better way of doing it. Old (bad) habits die hard.However, as far as I can tell, cat is needed for wc, as it outputs the filename as well. Of course, I could be wrong, but wc(1) doesn’t seem to have an option to supress the output of the filename. You could always
wc -l myproblems.txt | awk '{print $1}'but it serves the same purpose essentially.October 20th, 2008 at 11:22 am
aviation insurance…
rave articulating functor pasts.insidiously overshadows …