Bash Smart Complete Prevention and Extensionを無視

Bash Smart Complete Prevention and Extensionを無視

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ご覧のとおり、このリストにはありません。

おすすめ記事