Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 657

While Loop Read and JQ, use array list of column names

$
0
0

I want to pass a "array" to the while loop so I don't have to repeat the column names

COLUMNS=("SOURCE_FILE" "EXIF_CONTAINER" "EXIF_CODEC" "EXIF_ENCODER")while IFS=',' read -r SOURCE_FILE EXIF_CONTAINER EXIF_CODEC EXIF_ENCODERdo   #Do Processing here done < <(   echo "$EXIF_DATA"  | jq -cr '.[] | "\(.SourceFile),\(.EXIF_CONTAINER),\(.EXIF_CODEC), \(.EXIF_ENCODER)"')

How do I make the "while loop read" and "jq" use the COLUMNS list instead of having to repeat the column names?


Viewing all articles
Browse latest Browse all 657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>