use m4_normalize on the output strings to remove trailing spaces/tabs and consolidate...
[AROS.git] / workbench / c / shellcommands / EndShell.c
blob922d368bc6fd1938a3aebe8038fd5b8d189f9408
1 /*
2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: EndShell CLI command
6 Lang: English
7 */
9 /******************************************************************************
12 NAME
14 EndShell
16 SYNOPSIS
18 LOCATION
22 FUNCTION
24 Exits a Shell/CLI.
26 INPUTS
28 RESULT
30 NOTES
32 EXAMPLE
34 BUGS
36 SEE ALSO
38 INTERNALS
40 HISTORY
42 ******************************************************************************/
45 #include <proto/dos.h>
46 #include <dos/dos.h>
47 #include <dos/dosextens.h>
49 #include <aros/shcommands.h>
51 AROS_SH0(EndShell, 41.3)
53 AROS_SHCOMMAND_INIT
55 struct CommandLineInterface *cli = Cli();
58 if (cli)
60 struct FileHandle *fhin = BADDR(cli->cli_CurrentInput);
61 struct FileHandle *fhout = BADDR(cli->cli_StandardOutput);
63 cli->cli_Background = TRUE;
65 fhin->fh_Pos = fhin->fh_End + 1; /* Simulate an EOF */
66 fhout->fh_Pos = 0; /* don't flush cli's standard output on close*/
69 return RETURN_OK;
71 AROS_SHCOMMAND_EXIT