2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Unsetenv CLI command
9 /*****************************************************************************
27 NAME - The name of the global variable to unset.
31 Standard DOS error codes.
45 ******************************************************************************/
47 #include <proto/dos.h>
48 #include <proto/exec.h>
51 #include <dos/exall.h>
52 #include <dos/rdargs.h>
54 #include <exec/memory.h>
55 #include <exec/types.h>
56 #include <utility/tagitem.h>
57 #include <aros/shcommands.h>
59 AROS_SH1(Unsetenv
, 41.0,
60 AROS_SHA(STRPTR
, ,NAME
, ,NULL
))
65 if (SHArg(NAME
) != NULL
)
67 /* Delete the global variable from the list.
69 if (!DeleteVar(SHArg(NAME
), GVF_GLOBAL_ONLY
))
74 /* Display a list of global variables.
77 struct FileInfoBlock
*FIB
= NULL
;
81 !(lock
= Lock("ENV:", ACCESS_READ
)) ||
82 !(FIB
= AllocDosObject(DOS_FIB
, NULL
)) ||
83 (Examine(lock
, FIB
) == DOSFALSE
)
86 if (FIB
) FreeDosObject(DOS_FIB
, FIB
);
87 if (lock
) UnLock(lock
);
92 while (ExNext(lock
, FIB
))
95 if (FIB
->fib_DirEntryType
< 0)
97 FPuts(Output(),FIB
->fib_FileName
);
102 FreeDosObject(DOS_FIB
, FIB
);