Add $ENV builtin variable to access environment
This commit is contained in:
1 parent
1a8a0ae0f5
commit
3504bd9a2a
3 files changed
+60
-5
No files matched your search
@@ -1666,12 +1666,22 @@ sections:
|
||||
output:
|
||||
- '[{"a":{"b":2}}]'
|
||||
|
||||
- title: "`env`"
|
||||
- title: "`$ENV`, `env`"
|
||||
body: |
|
||||
|
||||
Outputs an object representing jq's environment.
|
||||
`$ENV` is an object representing the environment variables as
|
||||
set when the jq program started.
|
||||
|
||||
`env` outputs an object representing jq's current environment.
|
||||
|
||||
At the moment there is no builtin for setting environment
|
||||
variables.
|
||||
|
||||
examples:
|
||||
- program: '$ENV.PAGER'
|
||||
input: 'null'
|
||||
output: ['"less"']
|
||||
|
||||
- program: 'env.PAGER'
|
||||
input: 'null'
|
||||
output: ['"less"']
|
||||
|
||||
Reference in new issue
Block a user