GNU bug report logs - #12964
[PATCH] printenv: -n option added -- show names of variables.

Previous Next

Package: coreutils;

Reported by: Van de Bugger <van.de.bugger <at> gmail.com>

Date: Fri, 23 Nov 2012 00:31:02 UTC

Severity: wishlist

Tags: patch

Full log


View this message in rfc822 format

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Assaf Gordon <assafgordon <at> gmail.com>, Van de Bugger <van.de.bugger <at> gmail.com>, 12964 <at> debbugs.gnu.org
Subject: bug#12964: [PATCH] printenv: -n option added -- show names of variables.
Date: Wed, 10 Oct 2018 11:03:05 +0200
On 10/9/18 11:33 PM, Assaf Gordon wrote:
> With your patch, using "printenv -n VARNAME" adds
> the variable name to the output. e.g.:
> 
>     $ printenv HOME
>     /home/gordon
> 
>     $ printenv -n HOME
>     HOME=/home/gordon
> 
> From a cursory look this seems like a non-standard extension
> that is not available in any other 'printenv' implementations.

This feature looks like it should be possible to write out the current settings
to a file which could later be sourced in:

  printenv -n VAR > file

and in another shell (to get VAR back):

  . file

I'm afraid this is problematic once the value of a variable starts to have
funny characters, even a simple blank ' ' already screws things up.
For this kind of save/restore, -n would need to do correct shell quoting.

Have a nice day,
Berny




This bug report was last modified 6 years and 241 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.