"리눅스 여러 줄 출력을 한줄로 만들기"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
 
34번째 줄: 34번째 줄:
[[분류: sed]]
[[분류: sed]]
[[분류: xargs]]
[[분류: xargs]]
[[분류: 리눅스 멀티라인]]

2020년 12월 21일 (월) 11:50 기준 최신판

1 개요[ | ]

리눅스 여러 줄 출력을 한줄로 만들기
root@localhost:~# cat a.txt
hello
world
lorem
ipsum
스페이스 구분자
root@localhost:~# cat a.txt | xargs echo
hello world lorem ipsum
쉼표 구분자
root@localhost:~# cat a.txt | xargs echo | sed 's/ /,/g'
hello,world,lorem,ipsum
구분자 없음
root@localhost:~# cat a.txt | xargs echo | sed 's/ //g'
helloworldloremipsum


2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}