From f1f5f385bb2f27bb4393024296d0e409a2cee521 Mon Sep 17 00:00:00 2001 From: "W. Eric Norum" Date: Tue, 24 Apr 2001 19:35:57 +0000 Subject: [PATCH] Add `env' command to print enviornment variables. --- src/iocsh/iocUtil.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/iocsh/iocUtil.c b/src/iocsh/iocUtil.c index ccf5a9325..62002aa49 100644 --- a/src/iocsh/iocUtil.c +++ b/src/iocsh/iocUtil.c @@ -118,6 +118,17 @@ static void putenvCallFunc(const ioccrfArgBuf *args) } } +/* env */ +static const ioccrfFuncDef showenvFuncDef = {"env",0,NULL}; +static void showenvCallFunc(const ioccrfArgBuf *args) +{ + extern char **environ; + char **sp; + + for (sp = environ ; (sp != NULL) && (*sp != NULL) ; sp++) + printf ("%s\n", *sp); +} + /* iocLogInit */ static const ioccrfFuncDef iocLogInitFuncDef = {"iocLogInit",0}; static void iocLogInitCallFunc(const ioccrfArgBuf *args) @@ -132,5 +143,6 @@ void epicsShareAPI iocUtilRegister(void) ioccrfRegister(&pwdFuncDef,pwdCallFunc); ioccrfRegister(&showFuncDef,showCallFunc); ioccrfRegister(&putenvFuncDef,putenvCallFunc); + ioccrfRegister(&showenvFuncDef,showenvCallFunc); ioccrfRegister(&iocLogInitFuncDef,iocLogInitCallFunc); }