Signing back into the Community for the first time? You'll need to reset your password to access your account.  Find out more.

Forum Discussion

Former Member's avatar
Former Member
3 years ago

Environment variable interpolation

Hello!

I have a token stored in 1password and I'm trying to have it injected into another variable that holds the URL:

shell
export MY_TOKEN=op://foo/bar/token
export MY_URL=https://the_user:$MY_TOKEN@example.com

Even though I run it with op run, 1password cannot resolve the variable inside another, resulting in https://the_user:op://foo/bar/token@example.com. I tried using the template examples, but it seems to work only with the files.

Is there a way to achieve this string interpolation?

Thank you in advance!


1Password Version: 8.7.0
Extension Version: 2.0
OS Version: 12.4

  • Former Member's avatar
    Former Member

    I'm trying to do the same thing with no luck, is there a way?

  • Former Member's avatar
    Former Member

    Hey all,

    Thanks for reaching out to us!
    Currently, this is not possible. With op run, the environment is parsed all at once, and sourced all at once. Adding such a feature would mean sourcing each variable as soon as they're parsed. We have an internal issue tracking this, and will make sure to update you once there's any development around this.

    Thank you for the patience!
    Best,
    Horia