Can anybody explain this behaviour of the bash shell which is driving me nuts
[root@ns1 bin]# export test=`whois -h whois.lacnic.net 187.14.6.108 | grep -i inetn
Your test
contains something like
1234567 -I INPUT -s 187.12/14\r-J DROP
which, due to the carriage return, is visible only as
-J DROP -I INPUT -s 187.12/14
The CR moves the cursor to the start-of-line, where it then overwrites previous characters.
You could try
echo "$test" | od -bc
to verify this.