property=$(echo $(grep -A 1 -m1 "property" config.json | cut -f2 -d":" | tail -1 | sed 's/[,"]//g'))
with jq:
property=$(cat config.json | jq '.parameters | from_entries | .property')
- https://www.perlmonks.org/?node_id=518444 allows lookbehinds, so you do not need cut in grep commands after executing command.
e.g.
grep -Po "(?<=UBUNTU_CODENAME=).*" /etc/os-release
# Downloads folder via wget using requests Certificate Authority BUNDLE and Gitlab Personal Access Token (PRIVATE_TOKEN) to retrieve the <dir>/<subdir1>/<subdir2> folder and strip it 3 levels deep so that only the contents of subdir2 remain in the current directory.
wget --ca-certificate $REQUESTS_CA_BUNDLE -L --header "PRIVATE-TOKEN: $PRIVATE_TOKEN" "https://gitlab.com/api/v4/projects/<project id>/repository/archive.<format>?ref=<ref>&path=<subdir1>/<subdir2>" -qO - | tar -xzf - --strip-components=3
tar options:
x
extractf
filez
for gunzip files (i.e. for unzipping the .gz)