Archive for the 'Shell' Category

I got 99 problems but a bitch ain’t one!

Thursday, 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 [...]

Grep all files in a directory for a string

Saturday, June 30th, 2007

grep -i -r somestring ./
-i means ignore case
-r means recursive
Simple stuff, but useful nonetheless.