Results 1 to 8 of 8

Thread: Bash command set giving unexpected results

  1. #1
    Join Date
    Jun 2008
    Location
    Ballard
    Beans
    2,397
    Distro
    Ubuntu 16.04 Xenial Xerus

    Bash command set giving unexpected results

    I am studying bash.

    I understand that set is supposed to print (to screen) a list of variables and their values (similar to env which shows only exported variables).

    If I run set on my Mac I see the expected results. Running env on the Mac or my Ubuntu machines (8.10 and 9.10) also returns the expected results.

    However, running set on my Ubuntu machines yields what appears to be a script of some sort.

    Can someone tell me what's going on?
    "We're all in this together, kid." --H. Tuttle (a.k.a. H. Buttle)
    "Maybe it's a layer 8 problem." --thatguruguy
    A High-Tech Blech!

  2. #2
    Join Date
    Jul 2009
    Location
    London
    Beans
    1,480
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Bash command set giving unexpected results

    set also outputs any bash functions which have been defined. these will be displayed after the evironment variables. So maybe thats what you're seeing. if you do:
    Code:
    set | less
    it will page the results for you, you will (probably) see environment variables first, then at the at end any bash functions that have been defined.

  3. #3
    Join Date
    Jun 2008
    Location
    Ballard
    Beans
    2,397
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Bash command set giving unexpected results

    You are correct.

    Man, that's a lot of bash functions. I trust the book I'm reading will discuss enough to help me understand what that's all about.
    "We're all in this together, kid." --H. Tuttle (a.k.a. H. Buttle)
    "Maybe it's a layer 8 problem." --thatguruguy
    A High-Tech Blech!

  4. #4
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: Bash command set giving unexpected results

    Quote Originally Posted by jamesisin View Post
    You are correct.

    Man, that's a lot of bash functions. I trust the book I'm reading will discuss enough to help me understand what that's all about.
    Most of them are bash tab completion functions (/etc/bash_completion & /etc/bash_completion.d/*).

  5. #5
    Join Date
    Jun 2008
    Location
    Ballard
    Beans
    2,397
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Bash command set giving unexpected results

    Well, that's a little confusing. I thought bash had tab-completion built in. What extra help does it need that would require so much additional code?
    "We're all in this together, kid." --H. Tuttle (a.k.a. H. Buttle)
    "Maybe it's a layer 8 problem." --thatguruguy
    A High-Tech Blech!

  6. #6
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: Bash command set giving unexpected results

    Quote Originally Posted by jamesisin View Post
    Well, that's a little confusing. I thought bash had tab-completion built in. What extra help does it need that would require so much additional code?
    Custom completion options for different commands. i.e. username completion for chown

    http://www.debian-administration.org...pletion_part_1

  7. #7
    Join Date
    Jun 2008
    Location
    Ballard
    Beans
    2,397
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Bash command set giving unexpected results

    Thanks for that. Looks like good reading.
    "We're all in this together, kid." --H. Tuttle (a.k.a. H. Buttle)
    "Maybe it's a layer 8 problem." --thatguruguy
    A High-Tech Blech!

  8. #8
    Join Date
    Jun 2006
    Beans
    2,930

    Re: Bash command set giving unexpected results

    Imagemagik creates a bunch of them too.
    Support 7z in default installs!!!: Click Here

    How to use code blocks to post command output: Click Here
    Official Ubuntu Documentation

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •