উত্তর:
এটি / etc / bash_completion দ্বারা নিয়ন্ত্রিত হয়
আপনি পছন্দ না করলে _expand () এ সম্প্রসারণ কোডটি মন্তব্য করতে পারেন।
ফেডোরা ১ in-এ আমার সংস্করণটি এখানে রয়েছে তবে আপনার মত হওয়া উচিত:
# This function expands tildes in pathnames
#
_expand()
{
# FIXME: Why was this here?
#[ "$cur" != "${cur%\\}" ] && cur="$cur\\"
# Expand ~username type directory specifications. We want to expand
# ~foo/... to /home/foo/... to avoid problems when $cur starting with
# a tilde is fed to commands and ending up quoted instead of expanded.
if [[ "$cur" == \~*/* ]]; then
eval cur=$cur
elif [[ "$cur" == \~* ]]; then
cur=${cur#\~}
COMPREPLY=( $( compgen -P '~' -u "$cur" ) )
[ ${#COMPREPLY[@]} -eq 1 ] && eval COMPREPLY[0]=${COMPREPLY[0]}
return ${#COMPREPLY[@]}
fi
}
function _expand() { :;}মধ্যে দিয়ে ~/.bashrc।
bashনির্দিষ্ট কমান্ডের জন্য আরও পরিশীলিত অটোমোপ্লেশন সরবরাহ করতে পারে (উদাহরণস্বরূপ ফাইলের নাম ব্যতীত স্বয়ংক্রিয় পদ্ধতিতে যুক্তিগুলি)। আপনার সিস্টেমে কমান্ডের জন্য এমন একটি প্রোগ্রামেবল সম্পূর্ণ ফাংশন সংজ্ঞায়িত করা আছে vim।
completeকমান্ড প্রম্পটে টাইপ করা আপনাকে স্বতঃপূরণ প্রদান করতে কোন ফাংশন ব্যবহার করা হয় তা দেখাবে bash।
$ complete
complete -o default -F _complete_open open
type function_nameতাদের সংজ্ঞা সম্পর্কে জানতে টাইপ করুন ।
$ type _complete_open
_complete_open is a function
_complete_open ()
{
# function definition
}
ফাংশনটি কোথায় সংজ্ঞায়িত হয়েছিল তা সন্ধান করার জন্য। নিম্নলিখিত ব্যবহার:
$ shopt -s extdebug
$ declare -F _complete_open
_complete_open 70 /Users/danielbeck/.bash_profile