[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: env does not wrap variables that contain semicolon in quotes
From: |
Eric Blake |
Subject: |
Re: env does not wrap variables that contain semicolon in quotes |
Date: |
Fri, 20 Oct 2017 14:17:10 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 10/20/2017 01:27 PM, Minghui Liu wrote:
> 2. Save env output in a file
> env > env_save
'env' is not a bash builtin, so your bug report has no effect here. But
even if you were to send your bug report to bug-coreutils (assuming you
are using the coreutils version of env), they'd just tell you to use
'env -0', since that is the only delimiter that produces unambiguous
results, and that:
> 3. Source the file just saved
> . env_save
this is NEVER safe practice, unless 'env' were patched to have a new
output format specifically designed for reinterpretation in shell
(certainly 'env' and 'env -0' output is not designed for that). Maybe
adding 'env -p' (analagous to -p in various bash builtins) is a
worthwhile feature addition for upstream coreutils, but again, you'll
have to report this topic there.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature