{"id":13575949,"url":"https://github.com/hilbix/json2sh","last_synced_at":"2026-01-22T22:12:37.676Z","repository":{"id":141679212,"uuid":"115838254","full_name":"hilbix/json2sh","owner":"hilbix","description":"Convert arbitrary JSON streams to bash readable format","archived":false,"fork":false,"pushed_at":"2021-06-16T09:53:55.000Z","size":30,"stargazers_count":4,"open_issues_count":9,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-05T12:32:51.444Z","etag":null,"topics":["bash","json"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hilbix.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-12-31T02:43:49.000Z","updated_at":"2022-04-23T00:02:17.000Z","dependencies_parsed_at":"2024-01-14T03:49:43.558Z","dependency_job_id":"6b22b259-0061-429d-a908-ab5100accfd1","html_url":"https://github.com/hilbix/json2sh","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hilbix%2Fjson2sh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hilbix%2Fjson2sh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hilbix%2Fjson2sh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hilbix%2Fjson2sh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hilbix","download_url":"https://codeload.github.com/hilbix/json2sh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247293992,"owners_count":20915329,"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":["bash","json"],"created_at":"2024-08-01T15:01:05.718Z","updated_at":"2026-01-22T22:12:37.630Z","avatar_url":"https://github.com/hilbix.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"\u003e **Warning!** Versions before 2.0 had a critical bug!\n\u003e\n\u003e This is nearly not tested!\n\n[![json2sh dev Build Status](https://api.cirrus-ci.com/github/hilbix/json2sh.svg?branch=master)](https://cirrus-ci.com/github/hilbix/json2sh/master)\n\n\n# `json2sh` converts JSON into shell compatible output\n\n## Usage\n\n\tgit clone https://github.com/hilbix/json2sh.git\n\tcd json2sh\n\tmake\n\tsudo make install\n\nthen\n\n\tjson2sh \u003c\u003c\u003c'{\"w\":\"t\", \"f\":[ 6 ]}'\n\nor\n\n\tjson2sh 'x _' ' ' \u003c\u003c\u003c'{\"w\":\"t\", \"f\":[ 6 ]}'\n\nyou can even source it:\n\n\t. \u003c(json2sh \u003c\u003c\u003c'{\"w\":\"t\", \"f\":[ 6 ]}')\n\techo $JSON__0_w\n\nThis converter is incremental:\n- It only keeps the last value in memory.  So the document can be much bigger than the available RAM.\n- And it outputs things immediately when they are received.  Only 256 bytes of a value is buffered before it is output.\n\nThe output is bash compatible.  It uses following constructs:\n\n- `value` for simple values\n- `'value'` for normal values (which do not include a `'`)\n- `$'value'` for complex values (those which contain `'` or control characters)\n\nFor the variable names:\n\n- `A`-`Z`, `a`-`z`, `0`-`9` are used as is.\n- `_` becomes `__` (doubled), also in escape mode, `c` is `_`\n- Everything else is escaped as `_ESCAPE_` with ESCAPE made of:\n  - `abdefnrtv` are the corresponding control character (where `\\d` is `DEL` `7F` 127)\n  - `ghijklmopqsuwxyz` are the HEX nibbles in reverse (`z`=0, `g`=15, always in pairs)\n  - `0` stands for a `.` separating the object identifier parts (left away after indexes)\n  - `1`-`9` followed by other digits including `0` are array indexes.\n  - `A`-`Z` switches to a different Unicode planes, `A`=0 `Z`=25, `BA`=26 and so on,\n     followed by two HEX nibbles (except for plane 0, which can have controls).\n\n\n## FAQ\n\nWTF?\n\n- Yes, it works, indeed.\n\nReally?\n\n- Sure!\n\nWhat is it able to process?\n\n- http://www.json.org/\n- `true` becomes `$JSON_true_`\n- `false` becomes `$JSON_false_`\n- `null` becomes `$JSON_null_`\n- Empty array becomes `$JSON_empty_`\n- Empty object becomes `$JSON_nothing_`\n\nReturn codes?\n\n- 0 if JSON parses OK\n- 23 if something fails (OOPS)\n- 42 for usage\n\nContact/Bugs?\n\n- Open issue at GitHub\n\nContribution/Improvements?\n\n- Open Pull Request at GitHub\n\nLicense?\n\n- This Works is placed under the terms of the Copyright Less License,\n  see file COPYRIGHT.CLL.  USE AT OWN RISK, ABSOLUTELY NO WARRANTY.\n\n- Read: This is free as free beer, free speech and free baby.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhilbix%2Fjson2sh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhilbix%2Fjson2sh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhilbix%2Fjson2sh/lists"}