EDIT: Sorry, just realized how old this was; will leave this for
posterity and anyone coming in...

@husoki, did you see this comment --
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/83628/comments/1?
This is part of the very mature, much adored "bash completion" protocol
that allows authors to implement custom bash shell autocomplete
suggestion intelligence for their shell apps. If you're not familiar,
suggestions take place when you press TAB (twice in a row, usually)
whilst somewhere in the course of writing a command into the shell. A
common built-in example would be to type `/usr/b`, then TAB + TAB, at
which point `/usr/bin` would autofill in. If multiple possible results
exist, they would be displayed exhaustively in a useful, interactive
listing.

Apps often implement completion for everything from flags and param
names to subcommands even all the way to param values that require
external network traffic to fetch results, e.g.:

```
# TAB completion custom example

$ example-cloud-app get-user-d
_[TAB + TAB autofills to the following...]_
$ example-cloud-app get-user-details
_[user continues typing]...
$ example-cloud-app get-user-details --user-name=
_[TAB + TAB fetches users from remote and shows possible values...]_
$ example-cloud-app get-user-details --user-name=
zekev     husoski     johnd
$ example-cloud-app get-user-details --user-name=h
_[TAB + TAB]_
$ example-cloud-app get-user-details --user-name=husoski
```

In this example, the authors of `example-cloud-app` would have also
authored their bash_completion script, which would usually consist of a
callback function for the bash_completion lib to call when TAB + TAB is
pressed and the user wants results. That callback function is what you
see loaded into the env from the dump in here. If you want to see only
env vars without functions, you can just use the `env` command or
`printenv` and avoid using `set` which as discovered here also does
include functions in its output—a behavior that one can assume with
almost total certainty will probably never be removed given the
ubiquitous, simple alternatives and current historical expectations
which seem to me to be eminently reasonable. :)

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to bash in Ubuntu.
https://bugs.launchpad.net/bugs/83628

Title:
  Stuff from imagemagick ends up as environment variables

Status in bash package in Ubuntu:
  Invalid

Bug description:
  Binary package hint: imagemagick

  When running the 'set' command, stuff from ImageMagick ends up in the
  output.

  BASH=/bin/bash
  BASH_ARGC=()
  BASH_ARGV=()
  BASH_COMPLETION=/etc/bash_completion
  BASH_COMPLETION_DIR=/etc/bash_completion.d
  BASH_LINENO=()
  BASH_SOURCE=()
  ....
  bash205='3.2.9(1)-release'
  bash205b='3.2.9(1)-release'
  bash3='3.2.9(1)-release'
  _ImageMagick () 
  { 
      local prev;
      prev=${COMP_WORDS[COMP_CWORD-1]};
      case "$prev" in 
          -channel)
              COMPREPLY=($( compgen -W 'Red Green Blue Opacity \
                                  Matte Cyan Magenta Yellow Black' -- $cur ));
              return 0
          ;;
          -colormap)
              COMPREPLY=($( compgen -W 'shared private' -- $cur ));
              return 0
          ;;
          -colorspace)
              COMPREPLY=($( compgen -W 'GRAY OHTA RGB Transparent \
                                  XYZ YCbCr YIQ YPbPr YUV CMYK' -- $cur ));
              return 0
          ;;
          -compose)
              COMPREPLY=($( compgen -W 'Over In Out Atop Xor Plus \
                                  Minus Add Subtract Difference Multiply 
Bumpmap\
                                  Copy CopyRed CopyGreen CopyBlue CopyOpacity' 
                          -- $cur ));
              return 0
          ;;
  ...
  etc.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/83628/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to