Вероятно, это терминальная управляющая последовательность; вы можете извлечь их и распечатать по одному -на -один, чтобы увидеть, вызывает ли конкретная последовательность боркаге:
#!/usr/bin/env perl
use strict;
use warnings;
# turn off any encoding foo
use open IO => ':raw';
# "slurp" mode for whole file reads
local $/;
# for any STDIN or files given to us...
while (readline) {
# extract ESC-followed by a number of not-ESC not-NUL characters...
while (m/(\e[^\e\0]+)/g) {
printf "what does '%vx' do?\n", $1;
print $1;
# is a listing borked or not?
print qx(ls);
sleep 1;
}
}
Для этого можно использовать опцию -s
. Из описание POSIXsh
:
sh -s [-abCefhimnuvx] [-o option]... [+abCefhimnuvx] [+o option]...
[argument...]
-s
Read commands from the standard input.
If there are no operands and the -c option is not specified, the -s option shall be assumed.
Так:
% sh -s foo bar
sh-3.2$ echo "$@"
foo bar