Created
August 13, 2018 14:10
-
-
Save fabifrank/ca6269b4262022afd6df900af26f8801 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# read json entries line by line in a file and extract property of it | |
# usage: | |
# ./extract-json-prop.sh <FILENAME> <QUERY> | |
# example | |
# ./extract-json-prop.sh test.json .query.test | |
while IFS='' read -r line || [[ -n "$line" ]]; do | |
echo $line | jq "$2" | |
done < "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment