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