I mean the use of GNU env or BSD env command in the form of:
env [name=value ...] [utility [args ...]] Looks like there is no way to escape special characters in value part but I am not pretty sure how env is implemented to parse the value part.
I know there are many ways to do this by shell's feature but I want to pass literal string without shell's help (a bit like execute env by exec). That is to say, I need to find some kind of literal string format with newline and supported by env command. For example:
env FOO=LITERAL_STRING ruby -e 'puts ENV["FOO"]' Here the LITERAL_STRING should contain a literal string with newline and env should understand that format.
With the above command, the expected output should be:
hello world I wonder if it is possible. I would appreciate for your help.
Environment
envI use BSD
envso it can't print the version. Don't know ifmancan help:$ man env | tail -n1 BSD April 17, 2008 BSDOS
$ sw_vers ProductName: macOS ProductVersion: 11.6 BuildVersion: 20G165