Reputation: 12530
In a bash script I have the following command which removes the trailing \r\n
from the last line of a file.
# Copy the new last line but remove trailing \r\n
tail -1 $TMPOUT | perl -p -i -e 's/\r\n$//' >>$TMPOUT.1
It's currently using Perl to trim the \r\n
off, but the target system I'll need to run this on won't have Perl or any other scripts (uClinux/Busybox embedded device).
How can I achieve the same in 'pure' bash?
Upvotes: 0
Views: 121