variables in .profile

Discussion in 'macOS' started by wilburke, Jul 7, 2008.

  1. wilburke macrumors newbie

    Joined:
    Jul 7, 2008
    #1
    Setting up my environment for program building using .profile doesn' t work (eg extending the $PATH).
    It seems that appending a string to a variable just overwrites the initial value of the variable.
    My .profile contains following 2 lines:
    export TST="this is my first string"
    export TST2="$TST after expanding"
    After login in (I use puTTY) I get following values:
    $ echo $TST
    this is my first string
    $ echo $TST2
    after expanding string

    Can anybody help me?
     
  2. priller macrumors regular

    Joined:
    Dec 15, 2007
    #2
    Works fine with 10.5.4 & bash.

    gamma:~ priller$ echo $TST
    this is my first string
    gamma:~ priller$ echo $TST2
    this is my first string after expanding
     
  3. wilburke thread starter macrumors newbie

    Joined:
    Jul 7, 2008
    #3
    I'm working on 10.5.2
     
  4. wilburke thread starter macrumors newbie

    Joined:
    Jul 7, 2008
    #4
    BTW: how can I execute my (modified) .profile without logging out and logging in again?
     
  5. pilotError macrumors 68020

    pilotError

    Joined:
    Apr 12, 2006
    Location:
    Long Island
    #5
    You should be able to type

    . ./profile

    at the command line. the ".<space>" tells it to execute in your current shell.
     

Share This Page