Results 1 to 4 of 4
  1. #1
    Shambhavi
    Guest
    Not able to set environment variables using .profile file.
    Hi,
    I am trying to install Qt3.3.6 on my system. This requires a few variables to be set.

    Now the install manual instructs to create a .profile file (since my
    shell is bash) and set the environment variables there.
    I created the .profile in /Users/xyz as follows:

    QTDIR=/Developer/qt
    PATH=$QTDIR/binPATH
    DYLD_LIBRARY_PATH=$QTDIR/libDYLD_LIBRARY_PATH

    export QTDIR PATH DYLD_LIBRARY_PATH

    I saved the .profile file and did a reboot. But the env variables have
    not been set?
    What is going wrong?
    In the terminal $QTDIR is empty and the env command gives the following output:

    TERM_PROGRAM=Apple_Terminal
    TERM=xterm-color
    SHELL=/bin/bash
    TERM_PROGRAM_VERSION=133
    USER=xyz
    __CF_USER_TEXT_ENCODING=0x1F5:0:0
    PATH=/bin:/sbin:/usr/bin:/usr/sbin
    PWD=/Users/xyz
    SHLVL=1
    HOME=/Users/xyz
    LOGNAME=xyz
    SECURITYSESSIONID=584bf0
    _=/usr/bin/env

    Why are the variables $QTDIR and $PATH not updated?
    How do I set these variables?

    Please help I am newbie to Mac!

    Thanks in advance.

  2. #2

    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    I cut & pasted that content to a virgin .profile file and it worked properly.

    Open a Terminal window and type "echo $SHELL" without the quotes. If your really in the bash shell you'll see /bin/bash displayed.

    If not, I can tell you how to fix it.

    If your in the bash shell then type "cat .profile" to recheck the file.

    By the way, unless the qt development path has substitutions for commands in the regular path, I'd set the path as PATH=$PATHQTDIR/bin

  3. #3
    Shambhavi
    Guest
    echo $SHELL did give me
    /bin/bash

    while cat .profile gave
    cat: .profile: No such file or directory.

    While I can see the file being present (I have my show all files option of the Finder property turned ON)

    The way i created my .profile was went to TextEdit pasted the content that goes into it. Saved it as .profle (the format was RTF the default) in my Users/<myUserName> folder. i.e in my $HOME folder.

  4. #4
    Shambhavi
    Guest
    Thanks a lot xstep for ur cues. I got it solved. The problem was with i saved the file in RTF format.
    I recreated the file using VIM and now the variables are set.

    :-) Thank U!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. creating environment variables in environment.plist?
    By pines3 in forum OS X - Operating System
    Replies: 0
    Last Post: 01-25-2013, 02:17 AM
  2. Replies: 0
    Last Post: 01-23-2013, 07:39 PM
  3. How do I set environment variables in Leapord
    By Smacky311 in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 10-03-2008, 06:33 PM
  4. Setting Environment Variables
    By oquimdcr in forum OS X - Operating System
    Replies: 9
    Last Post: 09-09-2008, 01:51 AM
  5. How to set environment variables?
    By HSN in forum OS X - Apps and Games
    Replies: 5
    Last Post: 12-06-2007, 10:19 PM

Posting Permissions

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