Add $ENV builtin variable to access environment

This commit is contained in:
Nicolas Williams committed 2017-02-26 00:39:24 -06:00
1 parent 1a8a0ae0f5
commit 3504bd9a2a
3 files changed
+60 -5

No files matched your search

+12 -2
View File
@@ -1830,13 +1830,23 @@ jq \'walk( if type == "object" then with_entries( \.key |= sub( "^_+"; "") ) els
.
.IP "" 0
.
.SS "env"
Outputs an object representing jq\'s environment\.
.SS "$ENV, env"
\fB$ENV\fR is an object representing the environment variables as set when the jq program started\.
.
.P
\fBenv\fR outputs an object representing jq\'s current environment\.
.
.P
At the moment there is no builtin for setting environment variables\.
.
.IP "" 4
.
.nf
jq \'$ENV\.PAGER\'
null
=> "less"
jq \'env\.PAGER\'
null
=> "less"