@DATABASE "ADB06"
@INDEX "ADB:Misc/Index.Text/Main"
@HELP "ADB:Misc/Help/Main"
@NODE Main "AmigaDOS For Beginners - Part 6 - NewShell NewCLI EndShell EndCLI"

@{B}@{U}@{JCENTER}AMIGADOS FOR BEGINNERS

BY FRANK BUNTON

@{" COPYRIGHT © FRANK P. BUNTON 1993-1997 " LINK "ADB:Misc/Read_Me_First!!/Copyright"}

PART 6 -  NEWCLI    NEWSHELL    ENDCLI    ENDSHELL@{UB}@{UU}

@{" NewCLI & NewShell                    " LINK "New"}
@{" Starting New Shell/CLI From a Script " LINK "Starting"}
@{" New Shell/CLI Window Specification   " LINK "Specification"}
@{" EndCLI & EndShell                    " LINK "End"}

@{JCENTER}=== End of Text ===
@{JLEFT}
@ENDNODE

@NODE "New" "Part 6 - NewShell NewCLI EndShell"

@{B}@{U}NEWCLI AND NEWSHELL@{UB}@{UU}

@{B}Location@{UB}     - v1.3 & earlier - "c" directory
             - v2+ - Internal

@{B}Purpose@{UB}      - To open a new Shell or CLI window

@{B}Availability@{UB} - NewCli   - All AmigaDOS Versions
               NewShell - AmigaDOS 1.3 Onwards

It is sometimes handy to have two or more Shell/CLI windows open at the
same time. To do so, you enter one of these commands in an existing
window.

At this stage I will only deal with the brief use of these commands.
(See @{"Starting a New Shell ....." LINK "Starting"}.

Both commands, when used on their own (without any options) as in:-

  > NEWCLI           (v1.2 onwards)
  > NEWSHELL         (v1.3 onwards)

will produce a new CLI or Shell window.

@{B}V2+ notes@{UB} - both commands give the same thing as CLI and Shell are the
same.

@{B}V1.3 note@{UB} - NEWCLI will give the old style CLI window without all the
Shell enhancements. NEWSHELL is needed for that.

@{B}V1.2 note@{UB} - NEWSHELL not available - see @{"Part 2 AmigaDOS & Shell/CLI" LINK "ADB:Parts_01-10/02.AmigaDOS_&_CLI/Shell"}

@{JCENTER}=== End of Text ===
@{JLEFT}
@ENDNODE

@NODE "Starting" "Part 6 - NewShell NewCLI EndShell"

@{B}@{U}Starting a New Shell/CLI Window From a Script File (All versions)@{UB}@{UU}

Although we will not cover @{"script" LINK "ADB:Misc/Glossary/Scripts"} files until later, for the sake of
completeness I will give the format here for making a new Shell or CLI
window operate a script file. (A script file is simply a text file
containing one or more AmigaDOS command lines.)

The format for doing this is one of:-

  > NEWCLI FROM filename
  > NEWSHELL FROM filename

@{B}Note@{UB} - you@{B} MUST@{UB} include the keyword FROM unless the filename comes AFTER
a @{"window specification." LINK "Specification"}

The new Shell or CLI window will then be opened and the script file executed
within it. If the script file does@{B} NOT@{UB} end with a "ENDCLI" or "ENDSHELL"
command then the new window will remain in place.

The "FROM filename" can be added after the @{"window specification." LINK "Specification"}


@{JCENTER}=== End of Text ===
@{JLEFT}
@ENDNODE

@NODE "Specification" "Part 6 - NewShell NewCLI EndShell"

@{B}@{U}New Shell/CLI Window Specification@{UB}@{UU}

It is possible to specify a window size and name for the new process window
by using a "Con:" specification. For example:-

  > NEWSHELL Con:0/0/640/100/Title_of_Window
  > NEWSHELL Con:0/0/640/100/Title_of_Window FROM filename

The use of a window specification is covered in the article "Window
Specifications" in @{"Part 32." LINK "ADB:Parts_31-40/32.Window_Specs/MAIN"}

@{B}Note 1.3 users@{UB} - to get the full benefits of Shell instead of the old CLI
then use "Newcon:" instead of "Con:".

@{JCENTER}=== End of Text ===
@{JLEFT}
@ENDNODE

@NODE "End" "Part 6 - NewShell NewCLI EndShell"

@{B}@{U}ENDCLI AND ENDSHELL@{UB}@{UU}

@{B}Location@{UB}     - v1.3 & earlier - "c" directory (ENDCLI only)
             - v2.0 - Internal

@{B}Purpose@{UB}      - To close a Shell or CLI window

@{B}Availability@{UB} - EndCLI   - All AmigaDOS Versions
             - EndShell - AmigaDOS 2.0 onwards
                          (Only available as an alias in 1.3)

When I first opened a CLI window (in v1.2 days when I first got my Amiga)
I could not get rid of it! Other people have also asked how to do it.
In case you want to stop beating out your brains on CLI and go play a
game, you can get rid of the CLI or SHELL window with:-

  > ENDCLI

no extra options are used and, provided that no program has been started
(launched) from that CLI window, the window will disappear. Sometimes,
if a program has been launched from it, you will find that the window
stays on but is useless. We will discuss this later when we talk about
the "RUN" command (See article @{"RUN" LINK "ADB:Parts_01-10/09.Run/Main"}).

@{B}WARNING -@{UB} if you are working without a Workbench having been loaded (or,
in v2+, after the Workbench has been closed), and no other Shell/CLI is
running, then closing the Shell/CLI window will result in you being unable
to communicate with your Amiga!! You will need to reboot the system.
Therefore your should always make sure that at least one other Shell/CLI
window is open before closing one.

@{B}V2+ note@{UB} - ENDSHELL is a command in its own right but is identical to
ENDCLI.

@{B}V2+ note@{UB} - In v2+ you can also click on the close gadget at the top left
corner of the window to close the Shell/CLI window.

@{B}V1.3 note@{UB} - @{"ENDSHELL" LINK "ADB:Parts_31-40/34.Alias/Viewing"19} is not an AmigaDOS command but an "alias" (more on
@{"aliases" LINK "ADB:Parts_31-40/34.Alias/Main"} later). When the shell is started up it looks in a file called
"shell-startup" in the "s" directory which contains the aliases. ENDSHELL
has to be in this file if you are going to use it.

@{B}V1.2 note@{UB} - there is no ENDSHELL command as Shell was not then available.


@{JCENTER}=== End of Text ===
@{JLEFT}

@ENDNODE

