{"id":22025273,"url":"https://github.com/ronanyeah/bash-export","last_synced_at":"2026-05-08T07:34:18.064Z","repository":{"id":97194288,"uuid":"42993055","full_name":"ronanyeah/bash-export","owner":"ronanyeah","description":"how to use bash to export your vars","archived":false,"fork":false,"pushed_at":"2015-12-05T13:34:05.000Z","size":5,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T11:34:11.425Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ronanyeah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-23T09:58:21.000Z","updated_at":"2025-02-20T16:20:56.000Z","dependencies_parsed_at":"2023-03-14T07:45:14.194Z","dependency_job_id":null,"html_url":"https://github.com/ronanyeah/bash-export","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ronanyeah/bash-export","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronanyeah%2Fbash-export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronanyeah%2Fbash-export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronanyeah%2Fbash-export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronanyeah%2Fbash-export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ronanyeah","download_url":"https://codeload.github.com/ronanyeah/bash-export/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ronanyeah%2Fbash-export/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32771083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T02:36:36.067Z","status":"ssl_error","status_checked_at":"2026-05-08T02:36:07.210Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-30T07:15:29.677Z","updated_at":"2026-05-08T07:34:16.402Z","avatar_url":"https://github.com/ronanyeah.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Exporting environment variables using a bash script.\nHow to move away from [foreman](https://www.npmjs.com/package/foreman) etc for your environment variables and be a sick dev.\n\n**Step 1**  \nCreate a file in your project root folder called *env.sh* (or *anything.sh*).\n\n**Step 2**  \nPut *env.sh* in your *.gitignore*.\n\n**Step 3**  \nPUT *ENV.SH* IN YOUR *.GITIGNORE*.\n\n**Step 4**  \nFormat your file like this:\n```\n#!/bin/bash\nexport TEST_VAR='env vars loaded'\nexport ENVIRONMENT_VARIABLE_NAME=whatever\nexport ENV2=etc\nexport YOU_GET_THE_PICTURE=lol\nprintenv TEST_VAR\n```\nThe `printenv TEST_VAR` isn't necessary but I like to add it to give me some feedback that they have loaded correctly.\n\n**Step 5**  \nFrom the terminal, run: `$ . env.sh`.\n\n**Step 6**  \nIf it doesn't work, or the printenv doesn't show, run `$ chmod 755 env.sh` and try again.  \n(Got that trick from [here](http://ryanstutorials.net/bash-scripting-tutorial/bash-script.php).)\n\n**Bonus**  \nOn Windows you can use a PowerShell file called `env.ps1` formatted like this to export your variables:\n```\nSet-Item -path env:TEST_VAR -value 'env vars loaded'\nSet-Item -path env:ENVIRONMENT_VARIABLE_NAME -value 'whatever'\nSet-Item -path env:PORT -value 8888\nGet-ChildItem Env:TEST_VAR\n```\nYou can run the script in a PowerShell terminal with `\u0026 .\\env.ps1`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronanyeah%2Fbash-export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fronanyeah%2Fbash-export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fronanyeah%2Fbash-export/lists"}