I opened a terminal on the desktop in Xubuntu and typed set and then a new line. I aws expecting to see a display of my environmental variables, but all I got was a display of a lot of code. What on earth is going on?
Here's a bit of that code
pactl ()
{
local cur prev words cword preprev command;
local comps;
local flags='-h --help --version -s --server= --client-name=';
local list_types='short sinks sources sink-inputs source outputs cards
modules samples clients';
local commands=(stat info list exit upload-sample play-sample remove-sample load-module unload-module move-sink-input move-source-output suspend-sink suspend-source set-card-profile set-sink-port set-source-port set-sink-volume set-source-volume set-sink-input-volume set-source-output-volume set-sink-mute set-source-mute set-sink-input-mute set-source-output-mute set-sink-formats set-port-latency-offset subscribe help);
_init_completion -n = || return;
preprev=${words[$cword-2]};
for word in "${COMP_WORDS[@]}";
do
if in_array "$word" "${commands[@]}"; then
command=$word;
break;
fi;
done;
case $preprev in
list)
COMPREPLY=($(compgen -W 'short' -- "$cur"))
;;
play-sample)
comps=$(__sinks);
COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
;;
move-sink-input)
comps=$(__sinks);
COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
;;
move-source-output)
comps=$(__sources);
COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
;;
set-card-profile)
comps=$(__profiles);
COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
;;
set-*-port)
comps=$(__ports);
COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
;;
set-*-mute)
COMPREPLY=($(compgen -W 'true false toggle' -- "$cur"))
;;
set-sink-formats)
;;
set-port-*)
comps=$(__ports);
COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
;;
--server)
compopt +o nospace;
_known_hosts_real "$cur"
;;
esac;
[[ -n $COMPREPLY ]] && return 0;
case $prev in
list)
COMPREPLY=($(compgen -W '${list_types[*]}' -- "$cur"))
;;
stat)
COMPREPLY=($(compgen -W 'short' -- "$cur"))
;;
upload-sample)
_filedir
;;
play-sample)
;;
remove-sample)
;;
load-module)
comps=$(__all_modules);
COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
;;
unload-module)
comps=$(__loaded_modules);
COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
;;
set-card*)
comps=$(__cards);
COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
;;
*sink-input*)
comps=$(__sink_inputs);
COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
;;
*source-output*)
comps=$(__source_outputs);
COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
;;
set-sink-formats)
comps=$(__sinks_idx);
COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
;;
*sink*)
comps=$(__sinks);
COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
;;
*source*)
comps=$(__sources);
COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
;;
set-port*)
comps=$(__cards);
COMPREPLY=($(compgen -W '${comps[*]}' -- "$cur"))
;;
-s)
_known_hosts_real "$cur"
;;
esac;
[[ -n $COMPREPLY ]] && return 0;
case $cur in
--server=*)
cur=${cur#*=};
_known_hosts_real "$cur"
;;
-*)
COMPREPLY=($(compgen -W '${flags[*]}' -- "$cur"));
[[ $COMPREPLY == *= ]] && compopt -o nospace
;;
*)
[[ -z $command ]] && COMPREPLY=($(compgen -W '${commands[*]}' -- "$cur"))
;;
esac
}
env
will display your environment variables, notset
which is meant to display the names and values of shell variables including functions.