【发布时间】:2015-04-03 19:11:08
【问题描述】:
在 bash 脚本中,我使用以下命令从文件的最后一行删除尾随 \r\n。
# Copy the new last line but remove trailing \r\n
tail -1 $TMPOUT | perl -p -i -e 's/\r\n$//' >>$TMPOUT.1
它目前正在使用 Perl 来关闭 \r\n,但我需要运行它的目标系统没有 Perl 或任何其他脚本(uClinux/Busybox 嵌入式设备)。
如何在“纯”bash 中实现同样的效果?
【问题讨论】:
标签: linux bash terminal command