Artificial intelligent assistant

`declare -F` does not work in zsh `declare -f` Shows function definition in both bash & zsh. $ declare -f VCS_INFO_adjust () { # undefined builtin autoload -XUz } VCS_INFO_bydir_detect () { # undefined builtin autoload -XUz } VCS_INFO_check_com () { setopt localoptions NO_shwordsplit case $1 in (/*) [[ -x $1 ]] && return 0 ;; (*) (( ${+commands[$1]} )) && return 0 ;; esac return 1 } .... `declare -F` show functions name is bash but not in zsh. blueray@blueray-PC:~$ declare -F declare -f __expand_tilde_by_ref declare -f __get_cword_at_cursor_by_ref declare -f __git_eread declare -f __git_ps1 declare -f __git_ps1_colorize_gitstring declare -f __git_ps1_show_upstream declare -f __grub_dir declare -f __grub_get_last_option .... What might be the reason behind it?

In Zsh, `declare -F` declares a double-precision floating point variable:


$ declare -F myvar
$ echo $myvar
0.0000000000


To list all function names in Zsh, use `typeset -f +`.

In `zsh`, the `$functions` special associative array maps function names to their definition so `${(k)functions}` which expands to the _keys_ of that associative array will also expand to the list of function names.

Bash and Zsh are different shells, you can’t expect them to behave in exactly the same way.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 6036f4a4288758c34cf0833b67d46201