Skip to content

Instantly share code, notes, and snippets.

@Jimilian
Jimilian / key_value_pipe_to_json.sh
Last active January 20, 2023 08:11
Returns json created from pipe
#!/bin/bash
# Example:
# > echo "key1 value1 key2 value2" | ./key_value_pipe_to_json.sh
# {'key1': value1, 'key2': value2}
arr=();
while read x y;
do