<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: วิภาวดี อามาตย์สมับัติ</title>
    <description>The latest articles on DEV Community by วิภาวดี อามาตย์สมับัติ (@vipawadee).</description>
    <link>https://dev.to/vipawadee</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F966650%2F7c6e0f39-5e76-4edf-9bc0-edd81e958707.jpg</url>
      <title>DEV Community: วิภาวดี อามาตย์สมับัติ</title>
      <link>https://dev.to/vipawadee</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vipawadee"/>
    <language>en</language>
    <item>
      <title>How To Set Environment Variables For MacOS</title>
      <dc:creator>วิภาวดี อามาตย์สมับัติ</dc:creator>
      <pubDate>Thu, 31 Aug 2023 11:09:22 +0000</pubDate>
      <link>https://dev.to/vipawadee/how-to-set-environment-variables-in-macos-23af</link>
      <guid>https://dev.to/vipawadee/how-to-set-environment-variables-in-macos-23af</guid>
      <description>&lt;h2&gt;
  
  
  List all environment variables
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$printenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Check a specific environment variable
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$echo $[variable name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Set emporary environment variable
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1 :&lt;/strong&gt; Open &lt;code&gt;~/.bash_profile&lt;/code&gt; for add new environment variable&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$open ~/.bash_profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2 :&lt;/strong&gt; Add new environment variable to &lt;code&gt;~/.bash_profile&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export [variable_name]=[variable_value]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3 :&lt;/strong&gt; Save any changes to &lt;code&gt;~/.bash_profile&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Step 4 :&lt;/strong&gt; Use the &lt;code&gt;source&lt;/code&gt; to execute the new &lt;code&gt;~/.bash_profile&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$source ~/.bash_profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Set permanent environment variable
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1 :&lt;/strong&gt; Open &lt;code&gt;~/.zshrc&lt;/code&gt; for add new environment variable&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$open ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2 :&lt;/strong&gt; Add new environment variable to &lt;code&gt;~/.zshrc&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export [variable_name]=[variable_value]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3 :&lt;/strong&gt; Save any changes to &lt;code&gt;~/.zshrc&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Step 4 :&lt;/strong&gt; Use the &lt;code&gt;source&lt;/code&gt; to execute the new &lt;code&gt;~/.bash_profile&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$source ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Unset environment variable
&lt;/h2&gt;

&lt;p&gt;Use the &lt;code&gt;unset&lt;/code&gt; command to remove an environment variable&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$unset [variable_name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
  </channel>
</rss>
