Level up your business security with free, on-demand training and certification. Explore 1Password Academy today →
Forum Discussion
Anonymous
3 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
3 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