![Bash 스마트 완료 방지 및 확장 무시](https://linux55.com/image/119526/Bash%20%EC%8A%A4%EB%A7%88%ED%8A%B8%20%EC%99%84%EB%A3%8C%20%EB%B0%A9%EC%A7%80%20%EB%B0%8F%20%ED%99%95%EC%9E%A5%20%EB%AC%B4%EC%8B%9C.png)
bash에서 bar.dat 압축 풀기를 완료할 수 없는 이유 - 파일은 현재 디렉터리에 있습니다. bash는 파일 확장자를 읽고 도움을 주려고 합니까?
[a@localhost:~/tmp]$ echo "Hello World" > foo.txt
[a@localhost:~/tmp]$ zip bar.dat foo.txt
adding: foo.txt (stored 0%)
[a@localhost:~/tmp]$ unzip bar.dat <---- won't complete bar.dat
Archive: bar.dat
replace foo.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename: n
[a@localhost:~/tmp]$ file bar.dat
bar.dat: Zip archive data, at least v1.0 to extract
답변1
이는 bash
완료 기능을 통해 _install_xspec
수행 됩니다. 로컬 설정은 다를 수 있지만 일반적으로 다양한 파일 확장자 완성은 _xspecs
배열에 의해 제어됩니다. 이 작업을 수행:
$ set | grep _xspecs
로 시작하는 거대한 텍스트 벽을 볼 수 있습니다 _xspecs=(
. 다음에 대한 섹션도 있습니다 unzip
.
[unzip]="!*.@(zip|[ejsw]ar|exe|pk3|wsz|zargo|xpi|s[tx][cdiw]|sx[gm]|o[dt][tspgfc]|od[bm]|oxt|epub|apk|do[ct][xm]|p[op]t[mx]|xl[st][xm])"
dat
보시다시피 이 목록에는 없습니다.