Show HN: Jb / json.bash – Command-line tool (and bash library) that creates JSON
51–56 of 56 posts
Re: Show HN: Jb / json.bash – Command-line tool (and bash library) that creates JSON
#52 $ abc=123 jq -cn '$ENV | {abc, othername: .abc}'
{"abc":"123","othername":"123"}
$ jq -cn --arg abc 123 '{$abc, othername: $abc}'
{"abc":"123","othername":"123"}
$ jq -cn --argjson abc 123 '{$abc, othername: $abc}'
{"abc":123,"othername":123}Re: Show HN: Jb / json.bash – Command-line tool (and bash library) that creates JSON
#53Windows: what if everything was an (command) object? Linux: what if everything was a file? Soon we might have... Mong/Os: what if everything was JSON? YiAM/OS: YiAM/OS is ANOTHER MARKUP OPERATING SYSTEM... would come out shortly thereafter... I like JSON and getting in the terminal is a challenge - GOOD JOB!
Re: Show HN: Jb / json.bash – Command-line tool (and bash library) that creates JSON
#54Earlier quoted context omitted.
Two main situations I think. The first is just interactive use in any shell to encode ad-hoc JSON. If you have a next-gen shell which can handle structured data directly, then you probably don't need it. Second is situations where you'd rather not add an additional dependency, but bash is pretty much a given. For example, CI environments, scripts in dev environments, container entrypoints. Or things that area already…
> Second is situations where you'd rather not add an additional dependency, but bash is pretty much a given. For example, CI environments, scripts in dev environments, container entrypoints. Or things that area already written in bash. Is this tool not an additional dependency? > But bash is just really ubiquitous Biggest crime of the Unix world probably.
"Dependency" generally means "external dependency".
It's only a dependency if your solution's build process fetches it from its upstream repo. (Or worse: it's just mentioned in some manual build instructions as one of the things your solution needs.)
This is small enough to copy into the source tree of your solution, in which case it's no longer a dependency.
Re: Show HN: Jb / json.bash – Command-line tool (and bash library) that creates JSON
#55Re: Show HN: Jb / json.bash – Command-line tool (and bash library) that creates JSON
#56Now available from AUR: https://aur.archlinux.org/packages/json-bash-git