An open API service indexing awesome lists of open source software.

https://github.com/mrkara/json-utilities

Bash scripts designed to work with JSON files
https://github.com/mrkara/json-utilities

ai-generated bash-script json

Last synced: 7 months ago
JSON representation

Bash scripts designed to work with JSON files

Awesome Lists containing this project

README

          

# JSON Utilities

This repository contains two Bash scripts designed to work with JSON files: `json-merger.sh` for merging multiple JSON files into a single file, and `json-linter.sh` for validating JSON files.

## json-merger.sh

`json-merger.sh` is a simple Bash script designed to merge multiple JSON files into a single JSON file containing a JSON array of the objects from the input files. This tool is especially useful when dealing with multiple configurations or data files in JSON format that need to be combined into a single file for processing or analysis.

### Features

- Combines multiple JSON files into a single JSON file.
- Ensures the output is a valid JSON file by wrapping the contents in a JSON array.
- Simple and easy to use, requiring only the Bash shell.

### Installation & Usage

1. Clone this repository or download the `json-merger.sh` file directly.
2. Make the script executable: `chmod +x json-merger.sh`.
3. Use the script by running: `./json-merger.sh jsonFile1.json jsonFile2.json [...jsonFileN.json]`.

## json-linter.sh

`json-linter.sh` is a Bash script for validating JSON files. It uses `jq` to check if a given JSON file is valid. If the file is valid, the script outputs "Valid JSON"; otherwise, it prints "Invalid JSON".

### Prerequisites

- `jq` must be installed on your system to use `json-linter.sh`.

### Installation & Usage

1. Clone this repository or download the `json-linter.sh` file directly.
2. Make the script executable: `chmod +x json-linter.sh`.
3. Use the script by running: `./json-linter.sh jsonFile.json`.

## Contributing

Contributions are welcome! Please feel free to submit a pull request.

## License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

## Disclaimer

This repository and its content were generated by ChatGPT. While efforts have been made to ensure the scripts function as expected, they come with no guarantees or warranties. Users should review and test the scripts before using them in production environments.