Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
Former Member
4 years agoUnexpected op run behavior
Hello,
I'm excited to use the new features in CLI v2, but I'm having trouble getting op run to behave as expected.
In following the https://developer.1password.com/docs/cli/secret-references ...
andi_t_1P
1Password Team
4 years agoHi @jwhett, I believe using your commands in this way
```
op run --env-file=op-env -- sh -c 'echo $token'
op run --env-file=op-env -- sh -c 'curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $token" \
https://api.github.com/user'
``echo
will achieve the desired behaviour. I believe the reason behind it is that in your examplesandcurlattempt to resolve$tokenbefore they are being run as a subprocess ofop run`.
All the best,
Andi