[CentOS] text processing problem with bash/perl