2010-12-05 4 views
0

나는이 간단한 설정 한 :쉘 스크립트가 pipe라는 파일을 만드는 이유는 무엇입니까?

./pipetest.sh 

을 그리고 나는

ls 
    file.tar.bz2 mydir pipe pipetest.sh 

은 내 질문이있다 얻을 :

pwd 
/home/abc/pipetest 

ls 
mydir pipetest.sh 

을 지금은 할 왜 파일 명명 된 파이프가 생성 되었나요 ? vi를 사용하여 볼 수없는 일부 문자가 포함되어 있습니다. 무슨 일이야?

pipetest.sh에는 다음이 포함

#!/bin/sh 

directory_name=mydir 
tar cf pipe $directory_name 
bzip2 -c <pipe> file.tar.bz2 

답변

3

tar cf pipe $directory_namepipe라는 이름의 파일에 tar 파일을 작성합니다. 당신이 실제 파이프를 사용하고 싶지 무엇

:

tar c $directory_name | bzip2 > file.tar.bz2 

을하거나

tar cjf file.tar.bz2 $directory_name 
0
tar -cf pipe 

사용은 현재 디렉토리에 "파이프"라는 이름의 tar 파일을 생성한다.