perl -le "print for map tr/x//d ? $_ : (), @ARGV" 1 2 3x 4xx xxx 6x 3 4 6