{"id":14235813,"url":"https://github.com/dodie/bash-preprocessor","last_synced_at":"2026-01-16T07:02:07.857Z","repository":{"id":150757891,"uuid":"275597131","full_name":"dodie/bash-preprocessor","owner":"dodie","description":"Bash Macros: replace snippets in a script file with their output","archived":false,"fork":false,"pushed_at":"2020-06-29T17:34:43.000Z","size":7,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-13T01:34:39.585Z","etag":null,"topics":["bash","preprocessor"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/dodie.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-06-28T14:03:11.000Z","updated_at":"2022-09-02T08:39:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"cd78d3b6-b34d-4f91-bab7-709d4a4127de","html_url":"https://github.com/dodie/bash-preprocessor","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dodie/bash-preprocessor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodie%2Fbash-preprocessor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodie%2Fbash-preprocessor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodie%2Fbash-preprocessor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodie%2Fbash-preprocessor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dodie","download_url":"https://codeload.github.com/dodie/bash-preprocessor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dodie%2Fbash-preprocessor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269813625,"owners_count":24479340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bash","preprocessor"],"created_at":"2024-08-20T21:02:22.576Z","updated_at":"2026-01-16T07:02:07.832Z","avatar_url":"https://github.com/dodie.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# Bash Preprocessor: replace snippets with their output\n\n\n## Example: bake timestamp or version\n\n```bash\n#!/bin/bash\n\n@@@START@@@\necho \"# Build date: $(date)\"\n@@@END@@@\n\necho \"Hello World!\"\n```\n\nBy running the preprocessor on this file, the code between `@@@START@@@` and `@@@END@@@` will be executed and replaced by its output.\n\n```bash\n#!/bin/bash\n\n# Build date: Sun Jun 28 15:31:07 CEST 2020\n\necho \"Hello World!\"\n```\n\n\n## Example: statically import a file\n\nStuff can be imported from other scripts at runtime using `source`, but sometimes a self-contained script is better.\n\n\n```bash\n#!/bin/bash\n\n@@@START@@@\ncat another-script-file.sh\n@@@END@@@\n\necho \"Hello World!\"\n```\n\nIn this case, the resulting script file will contain everything from the other script file as well.\n\n\n## Usage\n\n1. Get `preprocess.sh`:\n    - grab and extract a [release](https://github.com/dodie/bash-preprocessor/releases)\n    - clone this repository\n    - simply copy `preprocess.sh`\n\n2. Run the script to preprocess a file (it will change its contents in place):\n    ```\n    ./preprocess.sh \u003cpath-to-file\u003e\n    ```\n\nIf needed the `@@@START@@@` and `@@@END@@@` tokens can be customized with an optional 2nd and 3rd argument:\n```\n./preprocess.sh \u003cpath-to-file\u003e \"\u003ccustom start token\u003e\" \"\u003ccustom end token\u003e\"\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdodie%2Fbash-preprocessor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdodie%2Fbash-preprocessor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdodie%2Fbash-preprocessor/lists"}