perl -le "$mask = 0x2b; print for map {$mask =>> 1?$_:()} @ARGV" and you will be pleased with the results #### perl -le "$mask = 0x2b; print for map {my $sel = $mask & 1; $mask = $mask >> 1; $sel?$_:()} @ARGV" and you will be pleased with the results and you be with #### perl -le "$mask = 0x2b; print for map {$mask >>= 1?$_:();} @ARGV" and you will be pleased with the results #### 43 43 43 43 43 43 43 43