Assuming no mining pool fees, you can use this:
#!/bin/bash
MHASHESPERSEC="$1"
HASHESPERSEC=`echo 'scale=2;' ${MHASHESPERSEC} '*1000000' | bc`
AVGTOWIN=`wget -q -O - http://blockexplorer.com/q/hashestowin`
AVGSECSTOWIN=`echo ${AVGTOWIN} '/' ${HASHESPERSEC} | bc -l`
AVGHOURSSTOWIN=`echo ${AVGSECSTOWIN} '/' 3600 | bc -l`
echo At $MHASHESPERSEC 'MegaHash/s', the expected BTC gain for 24h is: `echo 'scale=8;' '(50*24) / '${AVGHOURSSTOWIN} | bc -l`
Use it as follows:
bash ./pps.sh 7000
At [b]7000[/b] MegaHash/s, the expected BTC gain for 24h is: 4.69913750
If the op doesn't notice th extra '0' you snuck in there, he might get a bit excited about what he could earn