{"id":18524381,"url":"https://github.com/binpash/sh-expand","last_synced_at":"2025-09-09T18:09:15.327Z","repository":{"id":171150281,"uuid":"647471326","full_name":"binpash/sh-expand","owner":"binpash","description":"A library for statically expanding shell ASTs","archived":false,"fork":false,"pushed_at":"2025-02-10T00:07:05.000Z","size":124,"stargazers_count":7,"open_issues_count":4,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-21T12:56:15.149Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/binpash.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,"publiccode":null,"codemeta":null}},"created_at":"2023-05-30T21:21:32.000Z","updated_at":"2025-02-10T00:06:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5962815-4882-43b7-b16e-20df3eab0d6c","html_url":"https://github.com/binpash/sh-expand","commit_stats":null,"previous_names":["binpash/sh-expand"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binpash%2Fsh-expand","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binpash%2Fsh-expand/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binpash%2Fsh-expand/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binpash%2Fsh-expand/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binpash","download_url":"https://codeload.github.com/binpash/sh-expand/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248031642,"owners_count":21036446,"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","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-06T17:41:10.584Z","updated_at":"2025-04-09T11:32:02.732Z","avatar_url":"https://github.com/binpash.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sh-expand\n\nA python library for expanding shell ASTs that can be used to construct sound analyses for shell scripts (after having expanded the AST).\n\n## Design\n\nThere are two implementations of shell expansion:\n1. `expand.py` does an in-python expansion of simple \u0026 safe AST nodes. It doesn't support bashisms.\n2. `bash_expand.py` expands by conservatively echoing safe commands to a bash process containing the current shell state.\n\nBoth, when called via `expand_command`, recurse down into the words of a shasta AST node to\nexpand, leave the word as is, or raise an ExpansionError. Examples:\n- Process substitutions are unsafe.\n- Simple variable substitutions are safe.\n- Assignments are considered unsafe, since in Pash they indicate an unparallelizable region.\n\n`expand.py` interprets the ArgChars libdash parses (ex: for variable and process substitutions)\nto check and expand words.\n\nLibbash does not parse ArgChars, so `bash_expand.py` instead conservatively checks\nfor the presence of potentially expandable or unsafe literal characters (see `should_expand_var`)\nbefore expanding.\n\nNot having proper ArgChar parsing causes false positive unsafe errors,\nso `expand.py` should eventually be extended to support bash-only AST nodes,\nand libbash and shasta extended to parse ArgChars.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinpash%2Fsh-expand","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinpash%2Fsh-expand","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinpash%2Fsh-expand/lists"}