Tag Archive for 'tr'

Need to remove all those ^M characters from a DOS file?

Need to remove all those ^M characters from a DOS file? Try

tr -d \ \r < dosfile > newfile

(No space between two slashes.)

tr – translate or delete characters

Пример изменения текста:

lexus@reinstein:~$ echo lexus
lexus

lexus@reinstein:~$ echo lexus | tr [a-z] [A-Z]
LEXUS

Подробности – в man tr.