본문 바로가기
PRACTICE/Test

[csh] 파일의 내용을 한줄로 출력

by 1005 2021. 6. 26.
1
2
3
4
5
6
7
#한줄 출력
cat filesystem_list.tmp | perl --e “s|\n| |
 
 
#perl 뒤에 sed를 쓰려면 -l 옵션을 사용해서 버퍼링을 비활성화해야함.
perl -p -l -e “s|\n| || sed ‘s/ /-/g’
 

 

sed ‘s/ /-/g’ 대신 tr ' ' '-'을 써도 됨.

댓글