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.

3 Responses to 'I got 99 problems but a bitch ain’t one!'

  1. Gravatar 1 tehdely Says:

    Useless use of cat.

  2. Gravatar 2 Adam Says:

    Well, I did spend too little time and too much scotch on this. Of course grep bitch myproblems.txt is 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.

  3. Gravatar 3 aviation insurance Says:

    aviation insurance…

    rave articulating functor pasts.insidiously overshadows …

Leave a Reply

XHTML: Permitted tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>