problem : input: cd p, use tab completion, expect to enter the Pub_work directory, although auto-completion, successfully entered the directory, but to me print a series of characters, Tangled;
[Email protected]:~$ cd p+ local cur prev words cword
+ _init_completion
+ local exclude= flag outx Errx inx optind=1
+ getopts n:e:o:i:s Flag
+ compreply= ()
+ local ' [email protected] (? ( [0-9]) <|? ([0-9&]); (>) |>&) '
+ _get_comp_words_by_ref-n ' <>& ' cur prev words cword
+ local exclude flag I optind=1
+ words= ()
+ Local cur cword words
+ upargs= ()
+ upvars= ()
+ local Upargs upvars vcur vcword vprev vwords
+ getopts c:i:n:p:w:flag-n ' <>& ' cur prev words cword
+ Case $flag in
+ exclude= ' <>& '
+ getopts c:i:n:p:w:flag-n ' <>& ' cur prev words cword
+ [[[6-ge 3]]
+ Case ${! Optind} in
+ vcur=cur
+ Let ' optind + = 1 '
+ [[[6-ge 4]]
+ Case ${! Optind} in
+ Vprev=prev
+ Let ' optind + = 1 '
+ [[[6-ge 5]]
+ Case ${! Optind} in
+ vwords=words
+ Let ' optind + = 1 '
+ [[[6-ge 6]]
+ Case ${! Optind} in
+ Vcword=cword
+ Let ' optind + = 1 '
+ [[[6-ge 7]]
+ __get_cword_at_cursor_by_ref ' <>& ' words cword cur
+ words= ()
+ Local Cword words
+ __reassemble_comp_words_by_ref ' <>& ' words cword
+ Local exclude I J line ref
+ [[n <>&]]
+ exclude= ' <>& '
+ eval cword=1
+ + cword=1
+ [[n <>&]]
+ line= ' CD p '
+ ((i=0, j=0))
+ ((I < 2))
+ [[[0-GT 0]]
+ ref= ' words[0] '
+ eval ' words[0]=${!ref}${comp_words[i]} '
+ + WORDS[0]=CD
+ line= ' P '
+ [[0 = = 1]]
+ ((i++, J + +))
+ ((I < 2))
+ [[[1-GT 0]]
+ [[P = = + ([<>&]]]
+ ref= ' words[1] '
+ eval ' words[1]=${!ref}${comp_words[i]} '
+ + words[1]=p
+ line=
+ [[1 = = 1]]
+ eval cword=1
+ + cword=1
+ ((i++, J + +))
+ ((I < 2))
+ [[2 = = 1]]
+ Local I cur index=4 ' lead=cd p '
+ [[[4-GT 0]]
+ [[-n CD p]]
+ [[-N CDP]]
+ cur= ' CD p '
+ ((i = 0))
+ ((i <= Cword))
+ [[[4-ge 2]]
+ [[cd! = \c\d]]
+ [[[0-lt 1]]
+ Local old_size=4
+ cur= ' P '
+ Local new_size=2
+ index=2
+ ((++i))
+ ((i <= Cword))
+ [[[2-ge 1]]
+ [[! = \p]]
+ cur=p
+ ((index--))
+ [[[1-ge 1]]
+ [[P! = \p]]
+ [[[1-lt 1]]
+ ((++i))
+ ((i <= Cword))
+ [[-n p]]
+ [[!-n P]]
+ [[[1-lt 0]]
+ Local words Cword cur
+ _upvars-a2 Words CD p-v cword 1-v cur p
+ ((10))
+ ((10))
+ Case $ in
+ [[-N 2]]
+ printf%d 2
+ [[-N Words]]
+ unset-v Words
+ eval ' words= ("${@:3:2}") '
+ + words= ("${@:3:2}")
+ Shift 4
+ ((6))
+ Case $ in
+ [[-N Cword]]
+ unset-v Cword
+ eval ' cword= ' $ "
+ + cword=1
+ Shift 3
+ ((3))
+ Case $ in
+ [[-N cur]]
+ unset-v cur
+ eval ' cur= ' $ "
+ + cur=p
+ Shift 3
+ ((0))
+ [[-N cur]]
+ upvars+= ("$vcur")
+ upargs+= (-v $vcur "$cur")
+ [[-N Cword]]
+ upvars+= ("$vcword")
+ upargs+= (-v $vcword "$cword")
+ [[-N prev]]
+ [[[1-ge 1]]
+ upvars+= ("$vprev")
+ upargs+= (-v $vprev "${words[cword-1]}")
+ [[-N Words]]
+ upvars+= ("$vwords")
+ upargs+= (-a${#words [@]} $vwords "${words[@]}")
+ ((4))
+ Local cur cword prev words
+ _upvars-v cur p-v cword 1-v prev cd-a2 words CD P
+ ((13))
+ ((13))
+ Case $ in
+ [[-N cur]]
+ unset-v cur
+ eval ' cur= ' $ "
+ + cur=p
+ Shift 3
+ ((10))
+ Case $ in
+ [[-N Cword]]
+ unset-v Cword
+ eval ' cword= ' $ "
+ + cword=1
+ Shift 3
+ ((7))
+ Case $ in
+ [[-N prev]]
+ unset-v Prev
+ eval ' prev= ' $ "
+ + PREV=CD
+ Shift 3
+ ((4))
+ Case $ in
+ [[-N 2]]
+ printf%d 2
+ [[-N Words]]
+ unset-v Words
+ eval ' words= ("${@:3:2}") '
+ + words= ("${@:3:2}")
+ Shift 4
+ ((0))
+ _variables
+ [[P =~ ^ (\$\{?) ([a-za-z0-9_]*) $]]
+ RETURN 1
+ [[P = = @ (? ( [0-9]) <|? ([0-9&]); (>) |>&) *]
+ [[cd = = @ (? ( [0-9]) <|? ([0-9&]); (>) |>&]]
+ Local I Skip
+ ((i=1))
+ ((I < 2))
+ [[P = = @ (? ( [0-9]) <|? ([0-9&]); (>) |>&) *]
+ i=2
+ ((1))
+ ((I < 2))
+ [[[1-le 0]]
+ PREV=CD
+ [[-N ']]
+ Return 0
+ Local ' ifs=
' I j k
+ Compopt-o Filenames
+ [[-Z ']]
+ _filedir-d
+ Local I ' ifs=
' Xspec
+ _tilde P
+ Local Result=0
+ [[P = = \~*]]
+ Return 0
+ local-a Toks
+ Local quoted X tmp
+ _quote_readline_by_ref P quoted
+ ' ['-Z P '] '
+ [[p = = \ ' *]]
+ [[P = = \~*]]
+ printf-v quoted%q p
+ [[P = = *\\*]]
+ [[P = = \$*]]
+ + compgen-d--P
+ x=pub_work
+ read-r tmp
+ toks+= ("$tmp")
+ read-r tmp
+ [[-D! = d]]
+ [[-N ']]
+ [[[1-ne 0]]
+ Compopt-o Filenames
+ compreply+= ("${toks[@]}")
+ Return 0
ub_work/
+ CD pub_work/
[Email protected]:p ub_work$
The original is to open the Script debugging function, close just fine;
Used for script debugging. Set is to print the command below it to the screen
Set-x is open set +x is off Set-o is view (xtrace), set to chase the display of a piece of code.
After the set-x is executed, it is valid for the entire script.
Ubuntu_linux Automatic Completion problems