У меня есть файл с именем file1 со следующим содержанием:
The answer t
o your question
A conclusive a
nswer isn’t al
ways possible.
When in doubt, ask pe
ople to cite their so
urces, or to explain
Even if we don’t agre
e with you, or tell y
ou.
Я хочу преобразовать файл1 в файл2 . Последнее должно выглядеть так:
The answer to your question
A conclusive answer isn’t always possible.
When in doubt, ask people to cite their sources, or to explain
Even if we don’t agree with you, or tell you.
Если я просто выполняю cat file1 | tr -d "\ n"> file2 "
, все символы новой строки будут удалены. Но удалите только те символы новой строки , которые находятся в непустых строках с помощью утилиты tr (1)
?