env: Hide '.' variables in env print by default

When printing all variables with env print, don't print variables that
begin with '.'.  If env print is called with a '-a' switch, then
include variables that begin with '.' (just like the ls command).

Variables printed explicitly will be printed even without the -a.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
Joe Hershberger
2012-12-11 22:16:23 -06:00
committed by Tom Rini
parent ec8a252cd4
commit be11235ab8
13 changed files with 37 additions and 25 deletions

View File

@@ -107,7 +107,7 @@ extern int hdelete_r(const char *__key, struct hsearch_data *__htab,
int __flag);
extern ssize_t hexport_r(struct hsearch_data *__htab,
const char __sep, char **__resp, size_t __size,
const char __sep, int __flag, char **__resp, size_t __size,
int argc, char * const argv[]);
/*
@@ -120,9 +120,10 @@ extern int himport_r(struct hsearch_data *__htab,
const char *__env, size_t __size, const char __sep,
int __flag, int nvars, char * const vars[]);
/* Flags for himport_r(), hdelete_r(), and hsearch_r() */
/* Flags for himport_r(), hexport_r(), hdelete_r(), and hsearch_r() */
#define H_NOCLEAR (1 << 0) /* do not clear hash table before importing */
#define H_FORCE (1 << 1) /* overwrite read-only/write-once variables */
#define H_INTERACTIVE (1 << 2) /* indicate that an import is user directed */
#define H_HIDE_DOT (1 << 3) /* don't print env vars that begin with '.' */
#endif /* search.h */