How about somehting like:
Code:
#!/bin/bash
for i in `cat file.txt`; do
if [ `echo "$i" | grep bleh` ]; then
echo $new
else
echo "$i"
fi
done
I'm not too sure how you would be best to get the $new variable as I'm not sure what your line looks like from your description. You could probably use awk.