$ cat > lista.txt 1 2 3 $ cat lista.txt 1 2 3 $ wc -l lista.txt 3 lista.txt $ cat lista.txt | tr -d '\n' > lista_no_newline.txt $ wc -l lista_no_newline.txt 0 lista_no_newline.txt $ wc -c lista_no_newline.txt 3 lista_no_newline.txt $ cat lista_no_newline.txt 123$
Il carattere linefeed 0xA corrisponde a 012 in ottale, quindi
posso usare la sintassi ottale per il tr
$ tr -d '\012' < lista.txt > lista_no_newline.txt -rw-r--r-- 1 user user 6 May 20 16:47 lista.txt -rw-r--r-- 1 user user 3 May 20 16:48 lista_no_newline.txt
[ad name=”HTML”]