Aros/User/DOS

The AROS shell
In Dopus 5 Magellan - right mouse click -> Icaros -> Shell

In Wanderer (AROS Desktop / GUI), hit RightAROS + w (or F12 + w) (or use right mousebutton to access Wanderer's menu on the top of the screen) to open a shell window. To close the shell window, click on the top left X of the shell window or type in

endcli

or

endshell

Beginners Tutorial / Basic Usage
By default, the current directory is being displayed as part of the shell prompt. By default, the starting point is 'System:', the OS's root directory also known as sys:

Type 'dir' and hit return. You will see the contents of the current directory.

You can run an executable or enter a directory just by typing its name (and hitting return). Enter the 'C' directory simply by typing 'c' (AROS DOS is case insensitive):

Now press the up-arrow button twice. AROS shell has got a command history, which allows you to repeat or re-use commands quickly. Now you should see the 'dir' command again, so hit return. You will see the contents of the 'c' directory you've just entered.

This directory is AROS's primary location for executables which can be run from any directory. Now type '/' (just a slash) and hit return. You've just moved up one directory, back to 'System:'

Now try another 'dir' like command (which resides in the 'c' directory), 'list':

The output is quite the same as 'dir'. But you can control the 'list' output with options. AROS DOS command line options are recognized by their name, and eventually their position on the command line. Try this:

The output will now consist of all the directories contents which names contain the substring 'd'. Another example, another option:

This will list the contents matching 'd' recursively.

AROS dos script scripting
http://uk.aminet.net/docs/help/adosbegin.lha

http://se.aminet.net/pub/aminet/docs/help/adosbegin.lha

can be one of

- return code of the previous command is 5 or higher.

- return code of the previous command is 10 or higher.

- return code of the previous command is 20 or higher.

- check if file or directory exists.

- string comparison.

VAL - numeric comparison.

- same as EQ, just means "greater than".

- same as EQ, just means "greater or equal".

any of the above can be negated by NOT. e.g. use NOT GT for "less or equal" or NOT GE for "less than".

Escape Codes
07 Bell - Flash screen and sound bell 08 Backspace - move cursor back one position 09 vertical tab - move cursor up one line 10 line feed - move cursor down one line 11 is not listed in my book 12 form feed - clear screen 13 Carriage return - move cursor to start of line 14 Set MSB of each character. (Print extended chars) 15 Clear MSB of each character.
 * e[c - Clear window and turn all modes off
 * e[0m - All modes turned off
 * e[1m - Bold text enabled
 * e[3m - Italic enable
 * e[4m - Uderline
 * e[7m - Inverted text enable
 * e[8m - text becomes invisible (grey on grey)
 * e[3xm - Text colour becomes colour x (0-7)
 * e[4xm - Background colour becomes colour x (0-7)
 * e[n@ - Insert n spaces at cursor position.
 * e[nA - Cursor up n lines. Default 1
 * e[nB - Cursor down n lines. Default 1
 * e[nC - Cursor forward n characters. Default 1
 * e[nD - Cursor back n characters. Default 1
 * e[nE - Cursor next n lines(to column 1). Default 1
 * e[nH - Cursor to row n (Y position)
 * e[;nH - Cursor to column n (X position)
 * e[y;xH - Cursor to position X,Y
 * e[J - Erase from cursor to end of display
 * e[K - Erase from cursor to end of line
 * e[I - Insert line above line at cursor
 * e[M - Delete line at cursor
 * e[nS - Scroll up n lines
 * e[nT - Scroll down n lines
 * e[nt - set page length to n lines (in current font)
 * e[nu - Set line length in characters of current font
 * e[nx - Set left offset in characters
 * e[ny - Set top offset in lines
 * e[0 p - Disable cursor: Note space between zero and p
 * e[ p - Enable cursor. Note space

Example of coloured text in the shell

prompt "*E[>1m*E[1;37;41m%n.%s> *E[0;32;41m" echo "*E[0;0H*E[J"

Is a so called SGR command that omits the first few parameters. It turns BOLD ON.
 * E[>1m

SGR command that tells: - boldface (1) - foregroundcolor 7 (37). Which means it is using pencolor #7 (which is black by default on aros, hence the setpencolor command). - use background color 1 (41). Which means it is using pencolor #1 (which is black by default on aros). - %n means printing the current opened cli/shell-number - %s means printing the current path - > print a nice pipe token after all the above (and also a space-character).
 * E[1;37;41m%n.%s>

SGR command that tells: - plain text (0) - foregroundcolor 2 (32). Which means it is using pencolor #2 (which is white by default on aros). - backgroundcolor 1 (41). Which means it is using pencolor #1 (which is black by default on aros).
 * E[0;32;41m

command 'Cursor position' - set row to 0 (0) - set column to 0 (0) Please note that this does not seem to work on AROS as on classic (not checked). it seems that the lowest nr for AROS to use is 1 (for both left and top).
 * E[0;0H

command 'erase in display' (no additional parameters used in this command).
 * E[J

Drives, Files, Assigns, Directories
A certain set of directories and files needed by the operating system will be present in every AROS distribution. Additionally, "assigns" (logical, not physical, drives) point to physical drive's partitions or locations in the partition's directory structure.

Physical drives

 * By default harddrives on the IDE bus are assigned the drive names "DH0:", "DH1:", etc.
 * By default USB pendrives are assigned the drive names "DU0:", "DU1:", etc.
 * By default CD / DVD drives on the IDE bus are assigned the drive names "CD0:", "CD1:", etc.

SYS:Prefs
...contains all system preferences programs, like "Screenmode", "Locale", "Time", "Trident" (USB), etc. Is part of default path, thus entering "screenmode" in shell will bring up "Screenmode" prefs program.

SYS:Devs
...contains device drivers and datatypes. Move a file to the corresponding subdirectory of "SYS:Storage" to disable it (after reboot). More (currently disabled) device drivers or datatypes may be found unter "SYS:Storage", move to "Devs:" to enable (after reboot).

SYS:Storage
...is a directory meant to store optional or currently unused devices and datatypes. Move contents of "Devs:" (see above) here to disable device drivers (after reboot).

S:startup-sequence
...is a script that will be run when starting up the operating system. It is also used by some applications to store their individual requirements (if any - mosty this will be a line like "assign PROGRAMNAME: SYS:path/to/installation/of/PROGRAMNAME")

S:user-startup
...is a script that will be run by S:startup-sequence. It's the place to put your own stuff. Imagine you have some executable programs installed in a different directory than "C:" (or any other in default "path") but still want to access them without typing their full paths, you may add a line like this: "path WORK:path/to/my/program/ add".

It is also used by some applications to store their individial requirements (see above).

S:shell-startup
...is a script that will be run when starting up a new shell. By default, it contains commands that define the look of your shell prompt. See description of 'prompt' command.

Additional DOS commands
DMS Format: DMS Read file[.DMS] [FROM dev:] [TEXT filetext] [CMODE mode] [LOW lowtrack] [HIGH hightrack] [NOVAL] [NOZERO] [ENCRYPT password] DMS Write file[.DMS],,, [TO dev:] [LOW lowtrack] [HIGH hightrack] [NOVAL] [NOTEXT] [NOPAUSE [DECRYPT password] DMS Repack file[.DMS] [TO dev:] [LOW lowtrack] [HIGH hightrack] [CMODE mode] DMS View file[.DMS],,, [FULL] DMS Text file[.DMS],,, DMS Test file[.DMS],,, DMS Help Purpose: To read, write or view Disk Masher disk images of floppy disks. Example: DMS Write MyDisk.DMS FROM DF0:

Installer Format: Installer [SCRIPT] filename <[APPNAME] name> <[MINIUSER] level> <[DEFUSER] default> <[LOGFILE] logname> <[LANGUAGE] language>    Purpose: To install an application via a installer script. Usually provided as a default tool for script files in icon. Example: Installer SCRIPT InstallApp APPNAME MyProgram LOGFILE DH0:MyProgram.log

LHA Format: LHA [-options]  [[homedir] <filespec...] [@file] [destination] Purpose: To create, modify or list LHA or LZH files Examples: LHA a pictures.lha #?.jpg (archives all jpg files into pictures.lha) LHA l pictures.lha        (lists all files in pictures.lha) LHA x pictures.lha        (extracts all files from pictures.lha)

LZX Format: LZX [-options]  [ ...] [ ] Purpose: To create, modify or list LZX archive files. Examples: LZX a documents.lzx #?.doc (archives all doc files into documents.lzx) LZX l documents.lzx       (lists all files in documents.lzx) LZX x documents.lzx       (extracts all files from documents.lzx)

Additional DOS Information
Clear Screen Example: Echo "*E[0;0H*E[J" Purpose: Clears the screen. Uses printer commands to control text formatting in CLI, so *E is equivalent to ESC character.The command clear is normally defined using an Alias or an AmigaDOS script in S: folder.

Text in Italics Example: Echo "*E[3mItalics*E[23m" Purpose: *E[3m turns on italics and *E[23m turns off italics

Text in Bold Example: Echo "*E[1mBold*E[22m" Purpose: *E[1m turns on bold, and *E[22m turns off bold.

Underline Text Example: Echo "*E[4mUnderline*E[24m" Purpose: *E[4m turns on underline, and *E24m turns off underline.

Coloured Text Example: Echo "*E[32mRed Text*E[0m" Purpose: *E[nm where n=30-39 for foreground color or n=40-49 for background colour.
 * E[0m resets to normal character set.

Seems that Amiga shell allows an escape sequence to begin with just the 0x9B character, OR it allows the more traditional 0x1B character (033 in octal) followed the [ character. For sake of clarity, I will represent it by the C string \033[

AROS does not understand the \033[0m sequence, therefore you need to reset it using another colour sequence (on the assumption that the user has not changed the default Shell colours). This turns out to be \033[31;40m. It makes sense to play it safe, and follow it by the (ignored on AROS) \033[0m sequence.

Therefore my final highlight code looks like this: printf("Before\033[32;43mDuring\033[31;40m\033[0mAfter\n");

Or if you code in E (like me) then it is this: PrintF('Before\e[32;43mDuring\e[31;40m\e[0mAfter\n')

Examples
Is there a way to unzip more say 10 zipped archived at a time