We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running the shell with shopt -s failglob causes the ssh config file glob expansion in _included_ssh_config_files() to fail with an error.
shopt -s failglob
ssh
_included_ssh_config_files()
bash-5.0$ shopt -s failglob bash-5.0$ ssh <TAB>bash: no match: /etc/ssh/ssh_config.d/*.conf
Completion scripts should work without error even with failglob set.
failglob
GNU/linux/Ubuntu 20.04.4 LTS
5.0.17(1)-release
echo "$BASH_VERSION"
(IFS=.; echo "${BASH_COMPLETION_VERSINFO[*]}")
Latest completion scripts downloaded via git clone and copied into Ubuntu.
git clone
+ _included_ssh_config_files /etc/ssh/ssh_config + (( 1 < 1 )) + local configfile i f + configfile=/etc/ssh/ssh_config ++ shopt -po noglob + local 'IFS= ' 'reset=set -o noglob' + set -o noglob + included=($(command sed -ne 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:blank:]]\(.*\)$/\1/p' "${configfile}")) ++ command sed -ne 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:blank:]]\(.*\)$/\1/p' /etc/ssh/ssh_config ++ sed -ne 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:blank:]]\(.*\)$/\1/p' /etc/ssh/ssh_config + local included + set -o noglob + [[ -n /etc/ssh/ssh_config.d/*.conf ]] + for i in "${included[@]}" + [[ /etc/ssh/ssh_config.d/*.conf =~ ^~.*|^/.* ]] + __expand_tilde_by_ref i + [[ /etc/ssh/ssh_config.d/*.conf == \~* ]] + set +o noglob bash: no match: /etc/ssh/ssh_config.d/*.conf
The text was updated successfully, but these errors were encountered:
Thank you for the report and the debug trace. The error is caused by this line, where $i contains a glob pattern:
$i
bash-completion/bash_completion
Line 1743 in a7aabbc
We need to enclose the glob expansion by shopt -s nullglob; shopt -u failglob. The following line also has a quoting problem:
shopt -s nullglob; shopt -u failglob
Line 1747 in a7aabbc
Sorry, something went wrong.
Merge pull request #708 from akinomyoga/fix-failglob-included_ssh_con…
3414cb6
…fig_files feat(_comp_expand_glob): Add a utility to safely perform pathname expansions (Fix #705)
akinomyoga
Successfully merging a pull request may close this issue.
Describe the bug
Running the shell with
shopt -s failglob
causes thessh
config file glob expansion in_included_ssh_config_files()
to fail with an error.To reproduce
Expected behavior
Completion scripts should work without error even with
failglob
set.Versions (please complete the following information)
GNU/linux/Ubuntu 20.04.4 LTS
] Operating system name/distribution and version:5.0.17(1)-release
] bash version,echo "$BASH_VERSION"
:(IFS=.; echo "${BASH_COMPLETION_VERSINFO[*]}")
:Additional context
Latest completion scripts downloaded via
git clone
and copied into Ubuntu.Debug trace
The text was updated successfully, but these errors were encountered: