{"id":29272098,"url":"https://github.com/acook/modern.sh","last_synced_at":"2025-08-20T01:09:14.670Z","repository":{"id":137792187,"uuid":"430352614","full_name":"acook/modern.sh","owner":"acook","description":"Modern helpers for shell scripting","archived":false,"fork":false,"pushed_at":"2024-03-23T13:06:23.000Z","size":136,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-05T00:11:34.835Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acook.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-11-21T11:55:22.000Z","updated_at":"2021-11-21T17:09:14.000Z","dependencies_parsed_at":"2024-01-23T02:45:14.069Z","dependency_job_id":"d7df6ae1-a7e4-41ca-bf7a-49a9f9766bf7","html_url":"https://github.com/acook/modern.sh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/acook/modern.sh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acook%2Fmodern.sh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acook%2Fmodern.sh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acook%2Fmodern.sh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acook%2Fmodern.sh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acook","download_url":"https://codeload.github.com/acook/modern.sh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acook%2Fmodern.sh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271248164,"owners_count":24726037,"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-19T02:00:09.176Z","response_time":63,"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":[],"created_at":"2025-07-05T00:10:32.194Z","updated_at":"2025-08-20T01:09:14.640Z","avatar_url":"https://github.com/acook.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# modern.sh\n\nModern helpers for shell scripting.\n\n----\n\nI end up using a lot of shell scripting for portability and efficiency reasons.\nAs designed it is great for glue logic. But shell scripting has a lot of gaps.\n\n`modern.sh` fills some of these gaps by providing such capabilities as:\n\n- Including scripts as libraries - and ensuring they're only loaded once\n- Compatibility stubs and wrappers to ease development between Linux and BSD-like environments\n- Best-practice application of shell commands and features (like `safe_cd`)\n- Copious user feedback and visual indicators that are easy to read to aid debugability\n\nUsage\n=====\n\nThere is almost no boilerplate for your entry script to reliably find `modern.sh.`\n\nIf you have `modern.sh` in your path, you're good to start using it with just:\n\n```shell\nsource \"$(which modern.sh)\"\n```\n\nIf you set it up as a library in a relative path and aren't sure where it might end up, then you'll need to do something like this (where `libpath` is the relative path from your script):\n\n```shell\nsource \"$(dirname \"${BASH_SOURCE[0]}\")/libpath/modern.sh\"\n```\n\nPretty much every function is documented in `doc/help.ansi`, just display it in your terminal or an ansi-capable editor to read more:\n\n```shell\ncat doc/help.ansi\n```\n\nPlans\n=====\n\nI've used a lot of these functions for many years, copied from project to project, but this version was extracted from my `blacklight` programming language [build scripts](https://github.com/acook/blacklight/blob/redlight/build/lib/_shared.).\n\nWhile I mainly use `fish` interactively, `modern.sh` currently heavily depends on bash-isms due to it being readily available on all platforms I have come into contact as well as having a decent set of primitives to build on. While that has been a safe assumption for the last couple of decades, it is no longer the case. Making it `zsh` compatible will not be a stretch. Eventually `modern.sh` will grow a deeper compatibility layer to allow it to run on `dash` and `busybox` or similar.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facook%2Fmodern.sh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facook%2Fmodern.sh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facook%2Fmodern.sh/lists"}