The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Set global variable

Discussion in 'General Discussion' started by Lyttek, Nov 30, 2005.

  1. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    If I wanted to set a global environment variable and make it permanent and available at bootup, that would be by setting it in a script placed in /etc/profile.d , is that correct?
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Yes. Make sure it's chmod +x with the shebang line (e.g. #!/bin/sh) and then export your variable in it.
     
  3. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    Given the success of the GZIP=--rsyncable setting as applied to backups, is there any reason NOT to set that as a permanent, global variable? Will that force gzip to always use --rsyncable, system wide? Is there anyway to negate that locally, say by setting GZIP=null during script execution?
     
  4. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    da 'bump' n grind...
     
  5. perlchild

    perlchild Well-Known Member

    Joined:
    Sep 1, 2002
    Messages:
    279
    Likes Received:
    0
    Trophy Points:
    16
    you should do
    unset GZIP
    to remove a value, not set it to a particular one
     
Loading...

Share This Page