Find the answer to your Linux question:
Results 1 to 3 of 3
Hello all, I got a odd issue and I guess it would be easy to fix. However, I just don't get it. I am testing a Perl CGI Application and ...
  1. #1
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422

    [SOLVED] Envoirment Variables.

    Hello all,

    I got a odd issue and I guess it would be easy to fix.
    However, I just don't get it.
    I am testing a Perl CGI Application and I had some bugs in there.
    So, well patching time.
    So, I wanted to set my HTTP Cookie to run the script from the command line and see all the output.

    Thus:
    Code:
    [root@server http]# set HTTP_COOKIE=user=admin
    [root@server http]# echo $HTTP_COOKIE
    [root@server http]# set
    BASH=/bin/bash
    ..output trimmed..
    _=HTTP_COOKIE=user=admin
    shell=bash
    However it doesn't set the HTTP cookie value. it sets the value _ with my values.
    This is rather bothersome as I read:
    Perl CGI Script Debugging: Solving a 500 Internal Server Error (thesitewizard.com) and Environment Variables - Linux Commands


    How to set them. (and I remember doing it like this in the past)
    But it didnt seem to work.

    So, any advice / tips would be great

    Cheers all,
    Robin
    Last edited by RobinVossen; 11-04-2009 at 09:20 AM. Reason: typo in title
    New Users, please read this..
    Google first, then ask..

  2. #2
    Linux Engineer Kieren's Avatar
    Join Date
    Aug 2007
    Location
    England
    Posts
    845
    To set an environment variable in bash you need to use export:

    Code:
    export foo=bar
    Set was used in the cshell
    Linux User #453176

  3. #3
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    D'oh -.-'
    Thanks!

    [ Issue Solved ]
    New Users, please read this..
    Google first, then ask..

Posting Permissions

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