Im trying to parse lines in a file and read only characters t,c,a,g lower or upper case...but i keep getting trouble in the outcome:
for example axxxxtc should return atc but it doesnt...
heres my code:
result=`echo $line | grep [tcagTCAG]
any help plz?
grep will only match the lines (and return the entire line, not just the matched portions of it), and will not alter them. If you wish to alter the lines you are going to need to use sed, or something similar.