Quote:
Originally Posted by chrism01
Code:
for rec in `cat t1.t`
do
if [[ "$rec" =~ @ ]]
then
echo $rec
fi
done
where t1.t contains your stuff above ....
|
Thanks for the reply. I cant seem to get this to work.
here is my simple bash script.
#input file
ifile=/mnt/sql/ome_output.txt
#output file
ofile=/scripts/ome_work.txt
Code:
#pull only emails out of input
for rec in $ifile
do
if [[ "$rec" =~ @ ]]
then
echo $rec >> $ofile
fi
done
I dont get anything in ome_work.txt when it runs. What am i missing?
thanks,
Mitchell
edit...
NVM! i took out the cat of `cat t1.t` durr.... added that back in and bingo. Thanks