{"id":19006310,"url":"https://github.com/chewkeanho/polygotscripts","last_synced_at":"2026-03-05T22:31:30.341Z","repository":{"id":156815588,"uuid":"633162716","full_name":"ChewKeanHo/PolygotScripts","owner":"ChewKeanHo","description":"A single executable script format that is operable in both UNIX and WINDOWS environment.","archived":false,"fork":false,"pushed_at":"2024-02-19T05:16:54.000Z","size":1614,"stargazers_count":21,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-22T22:34:08.054Z","etag":null,"topics":["batch-script","linux","macos","polygot","posix-shell","powershell","powershell-script","unix","windows"],"latest_commit_sha":null,"homepage":"","language":"Batchfile","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/ChewKeanHo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"hollowaykeanho","custom":["https://www.hollowaykeanho.com/stores/"]}},"created_at":"2023-04-26T23:17:51.000Z","updated_at":"2025-11-14T21:24:12.000Z","dependencies_parsed_at":"2024-11-08T18:34:58.654Z","dependency_job_id":"243c705b-2104-4106-8d0e-f2532f24b65a","html_url":"https://github.com/ChewKeanHo/PolygotScripts","commit_stats":null,"previous_names":["chewkeanho/polygotscript","chewkeanho/polygotscripts"],"tags_count":4,"template":false,"template_full_name":"ChewKeanHo/AutomataCI","purl":"pkg:github/ChewKeanHo/PolygotScripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChewKeanHo%2FPolygotScripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChewKeanHo%2FPolygotScripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChewKeanHo%2FPolygotScripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChewKeanHo%2FPolygotScripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChewKeanHo","download_url":"https://codeload.github.com/ChewKeanHo/PolygotScripts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChewKeanHo%2FPolygotScripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30152846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T21:15:50.531Z","status":"ssl_error","status_checked_at":"2026-03-05T21:15:11.173Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["batch-script","linux","macos","polygot","posix-shell","powershell","powershell-script","unix","windows"],"created_at":"2024-11-08T18:31:45.882Z","updated_at":"2026-03-05T22:31:30.318Z","avatar_url":"https://github.com/ChewKeanHo.png","language":"Batchfile","funding_links":["https://github.com/sponsors/hollowaykeanho","https://www.hollowaykeanho.com/stores/"],"categories":[],"sub_categories":[],"readme":"# Holloway's Polygot Scripts\n[![Holloway's Polygot Scripts](artworks/logo-1200x630.svg)](https://github.com/hollowaykeanho/PolygotScript)\n\nThis is a reference repo serving as a sharing and quality control for my polygot\nscripts: **The same script can be operated in both UNIX and WINDOWS OSes**. This\nscript is generally used various multi-system distributions and fleet control\ninitialization where maintaining multi-OSes end products can be easily done.\n\n\n\n\n## Why It Matters\nMainly for multi-os decentralized packaging usage:\n\n1. **1 common starting point** - less communication errors; more control over\n   the package installation.\n2. **Maintainable and documentable** - 1 single start point; 1 set of\n   documentation only; 1 easy way to maintain the starting point command.\n3. **Simple and modular** - can easily drill down the errors due to\n   modularization and use the most basic commands available in both OSes.\n\n\n\n\n## The Products\nThe products are located in the root repository in various versions:\n\n1. [posix-batch-powershell.sh.ps1.cmd](posix-batch-powershell.sh.ps1.cmd) -\n   capable of running in:\n   1. POSIX Shell mode; AND\n   2. BATCH mode; AND\n   3. POWERSHELL mode.\n\n2. [posix-batch.sh.cmd](posix-batch.sh.cmd) - capable of running in:\n   1. POSIX Shell mode; AND\n   2. BATCH mode; AND\n\n\u003e [!NOTE]\n\u003e PowerShell knows how to execute batch script. No auto-correction is\n\u003e required.\n\n3. [posix-powershell.sh.cmd](posix-powershell.sh.cmd) - capable of running in:\n   1. POSIX Shell mode; AND\n   2. POWERSHELL mode.\n\n\u003e [!IMPORTANT]\n\u003e When executed in Batch mode, it will auto-correct itself to PowerShell and\n\u003e execute it from there.\n\n4. [posix-powershell.sh.ps1](posix-powershell.sh.ps1) - capable of running in:\n   1. POSIX Shell mode; AND\n   2. POWERSHELL mode.\n\n\n\n\n## File Extensions\nWhile UNIX systems do not demand for file extensions, Windows do have its\ncomplex and heavy requirement for it. As a practice, the file extension shall\nalways be lead by the UNIX (`.sh*`) and ends with Windows (either `*.cmd` for\nBatch initialization or `*.ps1` for PowerShell initialization).\n\nFor the highest portability, I recommend keeping the initialization with Batch\nmode since its execution can auto-correct to PowerShell mode when available\n(Refer [posix-powershell.sh.ps1](posix-powershell.sh.ps1) for how it's done).\n\nHence, this is the Polygot script's file extension I would recommend:\n\n```\nfilename.sh.ps1.cmd       # start by Batch\nfilename.sh.cmd.ps1       # start by PowerShell\nfilename.sh.cmd\nfilename.sh.ps1\n```\n\n\n\n\n## Maintain Simplicity for Sanity\nIt is always advisable to keep this script as simple as calling the OS-specific\ninitializing command rather than develop a\n[fat binary](https://en.wikipedia.org/wiki/Fat_binary) like executable script.\n\nIn case you don't know, coding all 3 types of scripts and compile into 1\nmanually can be a cumbersome task as the output file can easily become 3x\nlarger. Should it be too complex, you should use proper programming languages\nlike Go or Rust.\n\nPlease **DO NOT abuse it. You have been warned!**\n\n\n\n\n## License\nThis project is licensed under [MIT License](LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchewkeanho%2Fpolygotscripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchewkeanho%2Fpolygotscripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchewkeanho%2Fpolygotscripts/lists"}