linux shell下查看proc信息,尾部出现异常的打印,如图所示:
dmesg 未发现此信息,不是内核打印的
tail 不打印此信息,说明是cat 操作会打印该信息
cat /proc/cmdline > /dev/null
cat /proc/cmdline 2> /dev/null
cat /proc/cmdline 2>&1
cat /proc/cmdline > mytemp.txt
可确认:是cat的标准输出打印的,写入到文件时,应该是缓冲区内处理完字符后,把最终文本写入到文件
基于以上情况,可确认是busybox程序出了问题,但问题是,cat 操作究竟打印出了一个什么玩意
~ # strings /bin/busybox | grep ading Downloading %dK Uploading %dK too many leases while loading %s error reading key '%s' problem reading cylinder %d, expected %d, read %d WARNING: rereading partition table failed, kernel still uses old table loading error reading rpm header removing leading '%.*s' from member names error reading input font reading flags on %s reading %s reloading /etc/inittab
匹配 ading 的字符串有点多
SecureCRT Transfer菜单 -> "Receive ASCII", 接收到的字符如下:
~ # cat 1.txt abc Uploading 0K~ #
看来就是 Uploading %dK 这句导致的了