Bashパスの完成はsudoでどのように機能しますか?

Bashパスの完成はsudoでどのように機能しますか?

タブパスの完成は機能しません(少なくともUbuntuおよびAFAIK Archでは)

sudo mount <whatever>

マウントしたいisoファイルがそこにありません/etc/fstab

mount <whatever>

作業を完了すると効果的です(もちろん、ルートではないため、コマンドは失敗します)。どうやらそれがsudo壊れたのです。

完了タスクを完了するためにsudoを使用する方法は?

驚くべきことに、

sudo umount <whatever>

完了したプロジェクト。どのように達成されますか?調べますか/etc/fstab

解決策:/usr/local/bin私は呼び出しにシェルスクリプトを入れてsudo mount ...パラメータを渡しました。このスクリプトが呼び出されると、ジョブをブロックすることがないため、ジョブは完了しますsudo

ベストアンサー1

bashこれはパッケージ内のプログラミング完了とはまったく関係ありませんbash-completion

文書の一部の意見で判断すると、次のようになります/etc/bash_completion.d/mount

# mount(8) completion. This will pull a list of possible mounts out of
# /etc/{,v}fstab, unless the word being completed contains a ':', which
# would indicate the specification of an NFS server. In that case, we
# query the server for a list of all available exports and complete on
# that instead.
#

# umount(8) completion. This relies on the mount point being the third
# space-delimited field in the output of mount(8)
#

また、基本ファイルで/etc/bash_completionディスカッションmountumountコマンドを明確に説明する次の説明を見つけることができます。

# A meta-command completion function for commands like sudo(8), which need to
# first complete on a command, then complete according to that command's own
# completion definition - currently not quite foolproof (e.g. mount and umount
# don't work properly), but still quite useful.
#

修正する
:の説明とコマンドが削除されました。mountumountbash_completion犯罪:

_command_offset: Restore compopts used by called command.

This fixes completions that rely on their compopts, most notably
mount(8).
Fixes bash-completion bug #313183.

公開済み存在するbash-completion 1.90

おすすめ記事