1

When I type the set command in my system I've got this extract out :

__colormgr_commandlist='
    create-device
    create-profile
    delete-device
    delete-profile
    device-add-profile
    device-get-default-profile
    device-get-profile-for-qualifier
    device-inhibit
    device-make-profile-default
    device-set-kind
    device-set-model
    device-set-serial
    device-set-vendor
    find-device
    find-device-by-property
    find-profile
    find-profile-by-filename
    get-devices
    get-devices-by-kind
    get-profiles
    get-sensor-reading
    get-sensors
    get-standard-space
    profile-set-filename
    profile-set-qualifier
    sensor-lock
    sensor-set-options
    '
__grub_script_check_program=grub-script-check
_backup_glob='@(#*#|*@(~|.@(bak|orig|rej|swp|dpkg*|rpm@(orig|new|save))))'
_xspecs=([freeamp]="!*.@(mp3|ogg|pls|m3u)" [cdiff]="!*.@(dif?(f)|?(d)patch)?(.@([gx]z|bz2|lzma))" [bibtex]="!*.aux" [rgview]="*.@(o|so|so.!(conf|*/*)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)" [oowriter]="!*.@(sxw|stw|sxg|sgl|doc?([mx])|dot?([mx])|rtf|txt|htm|html|?(f)odt|ott|odm)" [chromium-browser]="!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))" [tex]="!*.@(?(la)tex|texi|dtx|ins|ltx|dbj)" [netscape]="!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))"
.../..
_xinetd_services () 
{ 
    local xinetddir=/etc/xinetd.d;
    if [[ -d $xinetddir ]]; then
        local restore_nullglob=$(shopt -p nullglob);
        shopt -s nullglob;
        local -a svcs=($( printf '%s\n' $xinetddir/!($_backup_glob) ));
        $restore_nullglob;
        COMPREPLY+=($( compgen -W '${svcs[@]#$xinetddir/}' -- "$cur" ));
    fi
}
dequote () 
{ 
    eval printf %s "$1" 2> /dev/null
}
quote () 
{ 
    local quoted=${1//\'/\'\\\'\'};
    printf "'%s'" "$quoted"
}
quote_readline () 
{ 
    local quoted;
    _quote_readline_by_ref "$1" ret;
    printf %s "$ret"
}

I checked all files in my knowledge as /etc/profile, /etc/environment, and/or ~/.bashrc. I didn't find any generation script or code calling.

Do you have any advice where is come from ?

  • Did you also check the files sourced from those files (if any)? – Kusalananda May 15 '17 at 8:10
  • Directories with additional files, most importantly /etc/profile.d have been common for about a decade. You have to read the files and see which other files they may include. – Bananguin May 15 '17 at 8:24
  • maybe files in /etc/profile.d/ or /etc/bashrc – Michael D. May 15 '17 at 8:25
  • 1
  • 1
    @Bananguin No, because dubis is actually looking for the definition of shell variables and functions, not the definition of environment variables. – Gilles 'SO- stop being evil' May 15 '17 at 22:55
4

For the functions, Bash can tell you where they came from:

$ help declare
...
  -F        restrict display to function names only (plus line 
            number and source file when debugging) 

$ shopt -s extdebug
$ declare -F quote_readline
quote_readline 150 /usr/share/bash-completion/bash_completion

(I found this mentioned in an answer on stackoverflow.)

For the environment variables, there are a bunch of good ways to find them here: How to determine where an environment variable came from

Most of those functions seem related to command line completion, my Ubuntu system has them in /usr/share/bash-completion/ as shown above.

FWIW, __colormgr_commandlist seems related to completion too, there's a script containing it here.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.