Jump to content

Search the Community

Showing results for tags 'env vars'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • General Discussion
    • Artificial Intelligence
    • DevOpsForum News
  • DevOps & SRE
    • DevOps & SRE General Discussion
    • Databases, Data Engineering & Data Science
    • Development & Programming
    • CI/CD, GitOps, Orchestration & Scheduling
    • Docker, Containers, Microservices, Serverless & Virtualization
    • Infrastructure-as-Code
    • Kubernetes & Container Orchestration
    • Linux
    • Logging, Monitoring & Observability
    • Security, Governance, Risk & Compliance
  • Cloud Providers
    • Amazon Web Services
    • Google Cloud Platform
    • Microsoft Azure

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


LinkedIn Profile URL


About Me


Cloud Platforms


Cloud Experience


Development Experience


Current Role


Skills


Certifications


Favourite Tools


Interests

Found 1 result

  1. Environment variables define the behavior of processes running on the system. These variables store information about the computing environment, and applications can access it to adapt their behavior accordingly. Hence, environment variable configurations impact your Linux system and its applications. Moreover, you can customize the computing environment by setting environment variables. Therefore, understanding how to declare environment variables is essential for all Linux users. It undoubtedly enhances efficiency and productivity. This short blog will discuss different ways of setting environment variables without difficulties. The export Command You can use the export command to set an environment variable. To use it, enter the below command in the terminal: export MY_VARIABLE=value This command would set an environment variable MY_VARIABLE with its value as “value.” You can use the command similarly by replacing “MY_VARIABLE” and “value” with your desired variable name and value, respectively. For example, to set a variable named PRATEEK_EV with the value “Hello World!”, enter: export PRATEEK_EV="Hello World!" On successful execution, it does not display anything, but you can confirm it using the printenv command. The set Command The set command is an alternative to the export command, which creates variables temporarily within a script or session: set MY_VARIABLE=value Again, replace the values according to your preferences. For instance, retaking the above example: set PRATEEK_EV="Hello World!" Permanent Environment Variables The environment variable you create using the set and export commands is temporary and stays in the system until you close your shell session. If you plan to set an environment variable for more extended periods, export it in the bash configuration file. nano ~/.bashrc The tildes(~) symbol indicates the home directory, and bashrc is the name of bash’s configuration file. For zsh or fish shells, you can use “nano ~/.zshrc” and “nano ~/.config/fish/config.fish” respectively. Now, append the below command into the file and save it: export MY_ENV="Information" A Quick Wrap-up Environment variables help shape the behavior of applications and scripts on Linux systems. Despite this importance, users often need to understand how to set environment variables. Hence, this blog provides the three easiest ways of setting environment variables using suitable examples. View the full article
  • Forum Statistics

    43.5k
    Total Topics
    42.9k
    Total Posts
×
×
  • Create New...