linux:bash:mengilangkan-empty-line-di-command-output
This is an old revision of the document!
Error loading plugin box
ParseError: syntax error, unexpected token "{"
More info is available in the error log.
ParseError: syntax error, unexpected token "{"
More info is available in the error log.
Error loading plugin changes
ParseError: syntax error, unexpected token "{"
More info is available in the error log.
ParseError: syntax error, unexpected token "{"
More info is available in the error log.
Menghilangkan Blank Output di Linux Command
Bagaimana cara menghilangkan output blank line atau empty line atau baris kosong menggunakan bash.
Contoh
Line:Text 1:<blank> 2:AAA 3:<blank> 4:BBB 5:<blank> 6:<space><space><space>CCC 7:<space><space> 8:DDD
Hasil yang ingin didapatkan adalah
1:AAA 2:BBB 3:<space><space><space>CCC 4:DDD <code> ===== Solusi ===== Apabila ingin menghilangkan baris kosong di dalam file <code> sed -i '/^$/d' file.txt
Apabila ketika menampilkan via cat
cat file.txt | tr -s '\n' '\n'
Selesai dan selamat mencoba
Layanan
Harga Domain .COM | Harga Domain .ID | Shared Hosting | Email Hosting | MySQL Hosting |linux/bash/mengilangkan-empty-line-di-command-output.1632276516.txt.gz · Last modified: by kbadmin
