Translate

Tuesday 8 September 2015

How to add System Variable/Environment Variable in Mac OS

Following are the steps to set up the variable.

1. Open terminal.
2. Type the command ->  touch ~/.bash_profile -  The touch utility sets the modification and access times of files.  If any file does not exist, it is  created with default permissions
3. Type the command ->  open ~/.bash_profile - This will open the file.
4. Then you will see a file, it could be blank or you can see some variables already there. Now there are two things:
    a. You want to create a new variable all together  the format will be
         export VariableName=Path/Value to be set   (Please mind the spaces)

    b. You want to append the path, like in case of JAVA Path.the format will be.
         export existingVariableName=$existingVariableName:new value to be appended
     
         For instance export PATH=$PATH:/usr/bin/java

5. Now You save the document by pressing Command + S
6. Now type the command - source ./.bash_profile - This will save your changes.
7. To check the value of your system variable simply  write - echo $YourVariableName


Hope that this helps!!

Thanks!!

6 comments:

  1. Hi Ankur,

    I need your help in Jasper Report.

    Please contact me on 9730348810

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. Thanks for the article, I was very excited to read it also check
    wordpress
    blogspot
    youtube
    ភ្នាល់បាល់

    ReplyDelete
  4. "The Masters Real Estate" is official sales partner of Lahore Smart City and 1st Smart City which is Capital Smart City . We are one of the most enticing options on the planet of real estate. Our prestigious forum provides the potential solution of all your ambiguities regarding the purchasing of shops, lands, and houses.

    We have engaged our teams in various cities of Pakistan as well as the online world to make our services accessible. The provision of reasonable price real estate properties by our company is attracting the residents and the foreigners. We have intended to provide luxurious construction projects and houses at affordable prices to our nation. One more socity launch soon which is Faisalabad Smart City .

    Also Check Location at: Lahore Smart City Location

    Our Other Projects are here: Nova City Islamabad | Park View City Lahore | Park View City Islamabad

    For More Visit: The Masters Real Estate

    ReplyDelete

Please post your queries or suggestions here!!