2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Getenv CLI command
9 /*****************************************************************************
25 Retrieves the information stored in the given global variable.
29 NAME - The name of the global variable.
33 Standard DOS error codes.
41 This will retrieve the version of the Kickstart ROM.
53 30-Jul-1997 laguest Corrected a few things in the source
54 27-Jul-1997 laguest Initial inclusion into the AROS tree
56 ******************************************************************************/
58 #include <proto/dos.h>
61 #include <dos/rdargs.h>
63 #include <exec/types.h>
65 #include <aros/shcommands.h>
67 #define BUFFER_SIZE 256
69 AROS_SH1(Getenv
, 41.1,
70 AROS_SHA(STRPTR
, ,NAME
,/A
,NULL
))
75 char Var_Value
[BUFFER_SIZE
];
79 Var_Length
= GetVar(SHArg(NAME
),
82 GVF_GLOBAL_ONLY
| LV_VAR
87 Display_Args
[0] = (IPTR
)Var_Value
;
88 VPrintf("%s\n", Display_Args
);
93 SetIoErr(ERROR_OBJECT_NOT_FOUND
);
94 PrintFault(IoErr(), "Getenv");