Usando sed
Com o GNU sed:
$ sed -zE 's/\n/ /g; s/.{70}/&\n/g; s/$/\n/' file
alfa bravo charlie delta echo foxtrot golf hotel india juliet kilo lim
a mike november oscar papa quebec romeo sierra tango uniform_victor_wh
iskey_xray yankee zulu
com qualquer POSIX sed:
sed -zE 'H;1h;$!d;x; s/\n/ /g; s/.{70}/&\n/g; s/$/\n/' file
Usando o awk
$ awk '{r=(length(r)?r" "$0:$0); while(length(r)>70){print substr(r,1,70); r=substr(r,71)}} END{print r}' file
alfa bravo charlie delta echo foxtrot golf hotel india juliet kilo lim
a mike november oscar papa quebec romeo sierra tango uniform_victor_wh
iskey_xray yankee zulu
Com tr e fold
$ tr '\n' ' ' <file | fold -w 70
alfa bravo charlie delta echo foxtrot golf hotel india juliet kilo lim
a mike november oscar papa quebec romeo sierra tango uniform_victor_wh
iskey_xray yankee zulu
O texto acima não produz uma nova linha à direita, mas podemos adicionar um, se necessário, com echo ""
:
tr '\n' ' ' <file | fold -w 70; echo