我尝试在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
代码不起作用,请帮我找到解决此问题的方案。