Getting started with 1Password for your growing team, or refining your setup? Our Secured Success quickstart guide is for you.
Forum Discussion
Former Member
4 years agoexport specific secret value as an environment variable
Hello 1Password Community :)
I am trying to fetch and export a specific secret value as an environment variable:
what I tried: - Note that I replaced the actual gcp location with [gcp location]...
Former Member
4 years agook now I got to receive the isolated value
old command that was almost getting me the value of the secret:
export AIRFLOW_SERVICE_ACCOUNT=$(op item get --cache --format=json [gcp location] | jq -r '.fields[]|select(.id="secret")|.value')
new command:
export AIRFLOW_SERVICE_ACCOUNT=$(op item get --cache --format=json [gcp location] | jq -r '.fields[]|select(.id=="secret")|.value')
only difference is the double "=" sign in the "select" field.