Consider the following:

shopt -s extdebug
mapfile -d" " < <(declare -F <bash_function_in_some_rc_file)

Results in the array MAPFILE having 3 entries with '2' entry containing the
filename
of bash function initial defining line

    $ vim "${MAPFILE[2}}" causes failure, not just for vim but cat for
example, however
    $ vim ${MAPFILE[2]} does not add '^@' at the end of the fle name,

    Comment:Seems weird but perhaps it is expected? If so that seems very
strange.
              No LSB modules are available.
              Distributor ID:   Ubuntu
              Description:      Ubuntu 22.04.3 LTS
              Release:  22.04
              Codename: jammy

LANG=en_CA.UTF-8
LANGUAGE=en_CA:en
LC_CTYPE="en_CA.UTF-8"
LC_NUMERIC="en_CA.UTF-8"
LC_TIME="en_CA.UTF-8"
LC_COLLATE="en_CA.UTF-8"
LC_MONETARY="en_CA.UTF-8"
LC_MESSAGES="en_CA.UTF-8"
LC_PAPER="en_CA.UTF-8"
LC_NAME="en_CA.UTF-8"
LC_ADDRESS="en_CA.UTF-8"
LC_TELEPHONE="en_CA.UTF-8"
LC_MEASUREMENT="en_CA.UTF-8"
LC_IDENTIFICATION="en_CA.UTF-8"
LC_ALL=

ldd `which bash`
linux-vdso.so.1 (0x00007ffed27f2000)
libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007fa3b23c8000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa3b21a0000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa3b257d000)


--------------------------------------------------------------
 Roger Federer Fanatic Extraordinaire :-)

Reply via email to