我试图在unix中的数据文件中找出不可打印的字符.代码:
#!/bin/ksh
export SRCFILE='/data/temp1.dat'
while read line
do
len=lenght($line)
for( $i = 0; $i < $len; $i++ ) {
if( ord(substr($line, $i, 1)) > 127 )
{
print "$line\n";
last;
}
done < $SRCFILE
Run Code Online (Sandbox Code Playgroud)
代码无效,请帮我解决上述问题.