| Server IP : 3.96.16.70 / Your IP : 216.73.216.15 Web Server : Apache System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /proc/self/root/etc/bash_completion.d/ |
Upload File : |
# This is a copy of the _filedir function in bash_completion, included
# and (re)defined separately here because some versions of Adobe
# Reader, if installed, are known to override this function with an
# incompatible version, causing various problems.
#
# https://bugzilla.redhat.com/677446
# http://forums.adobe.com/thread/745833
_filedir()
{
local IFS=$'\n'
_tilde "${cur-}" || return
local -a toks
local reset arg=${1-}
if [[ $arg == -d ]]; then
reset=$(shopt -po noglob)
set -o noglob
toks=($(compgen -d -- "${cur-}"))
IFS=' '
$reset
IFS=$'\n'
else
local quoted
_quote_readline_by_ref "${cur-}" quoted
# Munge xspec to contain uppercase version too
# https://lists.gnu.org/archive/html/bug-bash/2010-09/msg00036.html
# news://news.gmane.io/4C940E1C.1010304@case.edu
local xspec=${arg:+"!*.@($arg|${arg^^})"} plusdirs=()
# Use plusdirs to get dir completions if we have a xspec; if we don't,
# there's no need, dirs come along with other completions. Don't use
# plusdirs quite yet if fallback is in use though, in order to not ruin
# the fallback condition with the "plus" dirs.
local opts=(-f -X "$xspec")
[[ $xspec ]] && plusdirs=(-o plusdirs)
[[ ${COMP_FILEDIR_FALLBACK-} || -z ${plusdirs-} ]] ||
opts+=("${plusdirs[@]}")
reset=$(shopt -po noglob)
set -o noglob
toks+=($(compgen "${opts[@]}" -- $quoted))
IFS=' '
$reset
IFS=$'\n'
# Try without filter if it failed to produce anything and configured to
[[ -n ${COMP_FILEDIR_FALLBACK-} && -n $arg && ${#toks[@]} -lt 1 ]] && {
reset=$(shopt -po noglob)
set -o noglob
toks+=($(compgen -f ${plusdirs+"${plusdirs[@]}"} -- $quoted))
IFS=' '
$reset
IFS=$'\n'
}
fi
if ((${#toks[@]} != 0)); then
# 2>/dev/null for direct invocation, e.g. in the _filedir unit test
compopt -o filenames 2>/dev/null
COMPREPLY+=("${toks[@]}")
fi
} # _filedir()