쉘 스크립트를 이용하여 특정 단어를 뽑아 test.sh 파일에 입력했다고 쳤을때 test.sh 파일에 저장된 내용중 가장 마지막 한 줄은 삭제를 하고 싶은데 어떻게 구성을 해야 될까요...?? 그런 방법이 있나요..??
$ echo -e 'asdf\nqwer\nzxcv' | sed -e '$d' asdf qwer
-- C FAQ: http://www.eskimo.com/~scs/C-faq/top.html Korean Ver: http://www.cinsk.org/cfaqs/
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html Korean Ver: http://cinsk.github.io/cfaqs/
$ echo -e 'asdf\nqwer\nzxcv'
--
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
Korean Ver: http://www.cinsk.org/cfaqs/
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
Korean Ver: http://cinsk.github.io/cfaqs/