411 REFERENCE · Wikibooks
Aros/User/DOS
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
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:
System:>
Type 'dir' and hit return. You will see the contents of the current directory.
System:>dir
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):
System:>c
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.
System:c>dir
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:'
System:>
Now try another 'dir' like command (which resides in the 'c' directory), 'list':
System:>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:
System:>list sub d
The output will now consist of all the directories contents which names contain the substring 'd'. Another example, another option:
System:>list sub d all
This will list the contents matching 'd' recursively.
AROS dos script scripting
Have a look here for more
IF <condition>
; these commands are executed if the condition is true
ELSE
; these commands are executed if the condition is false
ENDIF
<condition> can be one of
WARN - return code of the previous command is 5 or higher.
ERROR - return code of the previous command is 10 or higher.
FAIL - return code of the previous command is 20 or higher.
EXISTS <filename> - check if file or directory exists.
<a> EQ <b> - string comparison.
<a> EQ <b> VAL - numeric comparison.
<a> GT <b> - same as EQ, just means "greater than".
<a> GE <b> - 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".
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.
Logical drives, "assigns"
SYS:
Extras:
DEVS:
Development:
L:
S:
LIBS:
C:
ENV:
RAM:
ENVARC:
MUI:
T:
Directories and files
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
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.
AROS DOS Commands Reference
Another list of Dos commands
Keydesc/A Required argument/F Final argument in list/K Keyword must be entered with argument/M Multiple arguments/N Number/S Switch (optional)
Addbuffers Format: Addbuffers Drive/A Buffers/NPurpose: Add memory to disk buffers to improve speed.Parameters:
Drive Name of drive
Buffers Number of 512k buffers to add.Example: Addbuffers DH0: 10
AddDatatypes Format: AddDataTypes files/M QUIET/S REFRESH/S LIST/SPurpose: Activates datatypes or adds another datatype if not detected at startupParameters:
files List of datatypes to add,
Quiet No output,
Refresh Update datatypes.Example: AddDataTypes gif.datatype REFRESH
Alias Format: Alias Name String/FPurpose: Assigns a short name to a dos command.Parameters:
Name Alias name,
String String or command to use for alias.Example: Alias Del Delete
Ask Format: Ask Prompt/APurpose: Asks a question in a script (reply y/n). Use IF WARN to test for a yes (value 5).Parameters:
Prompt Text to be displayed.Example: Ask "Are you sure? Y/n"
Assign Format: Assign Name Target/M LIST/S EXISTS/S DISMOUNT/S DEFER/S PATH/S ADD/S REMOVE/S VOLS/S DIRS/S DEVICES/SPurpose: Assign names to directory paths.Parameters:Name Name of the assign,
Target Directory path,
List Display list of assigns
Exists Test if assign exists (use IF WARN),
Dismount Remove assign
Defer Assign later
Path Add assign with path,
Add Add a new target to existing path (like LIBS:)
RemoveRemove an assign,
Vols List volumes,
DirsList directories,
Devices List devices.Example: Assign Development: Extras:bin
Avail Format: Avail CHIP/S FAST/S TOTAL/S FLUSH/SPurpose: Memory availabilityParameters:
Chip Display chip memory
Fast Display fast memory
Total Display all memory
Flush Free up memoryExample: Avail TOTAL
Break Format: Break Process/A/N ALL/S C/S D/S E/S F/SPurpose: Stop a program (see Status)Paramters:
Process Process name or Port
All Apply C,D,E and F
C Apply Ctrl+C
D Apply Ctrl+d
E Apply Ctrl+E
F Apply Ctrl+FExample: Break 2 C
CD Format: CD Dir/APurpose: Change directoryParameters:Dir Directory to change toExample: CD Text_Files
ChangeTaskPri Format: ChangeTaskPri Pri=Priority/A/N Process/K/NPurpose: Changes program's execution priority (see Status)Parameters:
Pri Priority to apply (-128 to +127)
Process Process number (see Status)Example: ChangeTaskPri 2 1
Conclip Format: Conclip Unit/N OFF/SPurpose: Activates clipboard deviceParameters:
Unit Clipboard unit
Off Turn off clipboardExample: Conclip 1
Copy Format: Copy From/M To/A ALL/S QUIET/S BUF=BUFFER/K/N CLONE/S DATES/S NOPRO/S COM/S NOREQ/SPurpose: Copy files (with/without protection bits)Parameters:
From Files to copy,
To Directory or file to copy to
All Copy all files,
Quiet No output,
Buffer Size of buffer (default = 100K)
Clone Copy file and datestamp, protect bits and comment
Dates Copy datestamp as well
NoPro Set default protection bits
Com Copy comment
NoReq No requester popupsExample: Copy mydoc.txt docs: Dates
Date Format: Date Day Date Time To=Ver/KPurpose: Display/change date or timeParameters:
Day Day of the Week,
Date Date in dd-mmm-yy format
Time Time in hh:mm[:ss] format
To Save to filenameExample: Date To=date.txt
Delete Format: Delete File/M/A ALL/S QUIET/S FORCE/SPurpose: Delete files and/or directories.Parameters:
Files One or more files
All Delete all subfolders and files
Quiet No output
Force Ignore protection flags when deletingExample: Delete OldFilesDir All
Dir Format: Dir Dir Opt/K ALL/S DIRS/S FILES/S INTER/SPurpose: List contents of a directoryParameters:
Dir Directory
Opt Option
Dirs List directories
Files List Files
Inter Interactive mode.Example: Dir S: Files
Diskchange Format: Diskchange Device/APurpose: Tell Dos that a disk has been swapped in a non-autosensing disk drive.Parameters:Device Name of removable device.Example: Diskchange DU2:
Echo Format: Echo String/M NOLINE/S FIRST/K/N LEN/K/N TO/KPurpose: Display text in a script or part of a string of text.Parameters:
String Text to display
NoLine Do not print a new line
First Position of first character
Len Length of substring
To Destination fileExample: Echo "Enter your name: " NoLine
Else Format: ElsePurpose: Used with IF, if not true do these commandsExample:
If Exists s:User-Startup
Else
Endif
EndCLI Format: EndCLIPurpose: Close CLI console windowExample: EndCLI
Endif Format: EndifPurpose: End a IF..ELSE..ENDIF blockExample: If $Age GT 65
Else
Endif
Endskip Format: EndskipPurpose: Stops a SKIP branch (for debugging)Example: Endskip
Eval Format: Eval Value1/A Op Value2/M To/K LFormat/KPurpose: Evaluate a simple arithmetic expressionParameters:
Value1, Value2 Values to evaluate (Decimal, Hex (0xn) or Octal (0nnn),
Op Operlexiaation (+,-,*,/,^,%),
To File to save result,
LFormat Output format string (use *n to give a line feed).Example: Eval $count + 1 to env:count
Execute Format: Execute File/APurpose: Execute a script or batch fileParameters:File Script file to executeExample: Execute PCD
Failat Format: Failat RCLIM/APurpose: Change failure limit for scripts (0,5,10,20) (0 - Ok, 5 - Warn, 10 - Error, 20 - Fail)Parameters:RCLIM Failat number (0-20)Example: Failat 20
Fault Format: Fault Error/N/MPurpose: Display error message from a codeParameters:Error One or more error numbersExample: Fault 221 "Fault 221: Disk is full"
FileNote Format: Filenote File/A Comment ALL/S QUIET/SPurpose: Attach a comment to a file (see LIST)Parameters:File File to add comment to
Comment Text to apply
All Apply to all files,
Quiet No outputExample: FileNote List.txt "A list of people's names"
Format Format: Format Device Drive/K/A Name/K/A OFS/FFS/SFS DIRCACHE/S NODIRCACHE/S NOICONS/S QUICK/SPurpose: Initialises AROS disks (in System drawer)Parameters:Device|Drive Disk device or name to format
Name New volume name
OFS Old Filing System
FFS Fast File System
Intl|International FFS International mode
NoIntl|NoInternational International mode off
SFS Smart Filesystem
DirCache|NoDirCache Directory caching on or off,
NoIcons No disk or trash icons
Quick Less thorough formatExample: format drive dh0: name AROS
Format Drive DH2: Name Docs SFS NOICONS QUICK
Get Format: Get Name/APurpose: Returns contents of local env variableParameters:Name Enviornment variable nameExample: Get RC
Getenv Format: Getenv Name/APurpose: Return contents of a global environment variableParameters:Name Enviornment variable nameExample: Getenv Wanderer
Iconx Format: IconxPurpose: Enables a script to be run from Workbench. The script must have a Project .info file and the Default Tool set to c:IconX to run it.Example: Iconx
If Format: If NOT/S WARN/S ERROR/S FAIL/S EQ/K GT/K GE/K VAL/S EXISTS/KPurpose: If condition is true execute following commands until an ELSE or ENDIF occurs.Parameters:
Not Reverse boolean result,
Warn Test warn flag from previous command,
Error Test error flag from previous command,
Fail Test fail flag from previous command,
EQEquality test,
GT Greater than test,
GEGreater or equal test,
VALInput is a number,
Exists Test file exists.Example: IF WARN, IF $count GT 10, IF EXISTS C:List
Info Format: Info DevicePurpose: Displays information about disksParameters:Device Name of device to displayExample: Info DH0:
Install Format: Install Device/A NOBOOT/S CHECK/S FFS/SPurpose: Saves a bootblock to a disk. If you have only one drive type INSTALL ? and swap disks and then type DF0: and press RETURN to save bootblock.Parameters:Device Disk to install bootblock,
NoBoot Erase bootblock,
Check Test for bootblock, FFS = Use Fast File System.Example: Install DH0:
IPrefs Format: IPrefsPurpose: Initialises preferences files on startup.Example: IPrefs
Join Format: Join File/M/A AS=TO/K/APurpose: Join two or files together.Parameters:File File(s) to join together,
To|as Destination fileExample: Join File1 File2 File3 as FileFull
Lab Format: Lab LabelPurpose: State a Label to Skip to in a scriptParameters:Label Name of labelExample: Lab PROC2
List Format: List Dir/M P=PAT/K KEYS/S DATES/S NODATES/S To/K Sub/K Since/K Upto/K QUICK/S BLOCK/S NOHEAD/S FILES/S DIRS/S LFORMAT/K ALL/SPurpose: List file details in a directory.Parameters:
Dir One or more directory name(s)
Keys Display keys
NoDates Do not display dates
To Destination file
Sub Subdirectories included
Since List files since date given
Upto List files upto given date
Quick Simple directory list
Block List files in block sizes
NoHead Do not display header lines
Files Files only
Dirs Directorys only
LFormat Output list using this format string
All All filesExample: List Development: Block Dates Since=01-Jul-00
Lock Format: Lock Drive/A ON/S OFF/S PasskeyPurpose: Lock a device from writing.Parameters:
Drive Drive to lock
On|Off Turn lock on or off
PassKey Specify password.Example: Lock DH1: On GHK459
MakeDir Format: Makedir Name/MPurpose: Create one or more new directories.Parameters:
Name One or more directories to create.Example: MakeDir DH1:Docs DH1:Basic DH0:TempFiles
MakeLink Format: MakeLink From/A To/A HARD/S FORCE/SPurpose: Creates a logical link between filesParameters:
From Link file
To Actual file
Hard Hard link
Force Link to sub-directoryExample: MakeLink T C:Type Hard
Mount Format: Mount Device/M From/KPurpose: Loads and mount a deviceParameters:
Device Device to mount
From Mount fileExample: Mount DEVS:CD0
NewShell Format: NewShell Window FromPurpose: Open a new Shell console (CON) windowParameters:
Window Window config string
From Alternative script to Shell-Script.Example: NewShell From S:Shell-Startup
Path Format: Path Path/M ADD/S SHOW/S RESET/S REMOVE/S QUIET/SPurpose: Set or change the program search pathParameters:
Path Directory path to change
Add Add path
Show Display path,
Reset Clear path
Remove Remove entry from path
Quiet No outputExample: Path SC:C Add
Prompt Format: Prompt PromptPurpose: Change the prompt text (Codes: %R = last return code, %S = Current path, %N = CLI Number)Parameters:
Prompt Path formatExample: Prompt "%N.%S> "
Protect Format: Protect File/A Flags ADD/S SUB/S ALL/S QUIET/SPurpose: Change the 'rwedsp' flags of a file. (r=read,w=write, e=execute,d=delete,s=script,p=pure)Parameters:
File File to change
Flags One or more flags
Add Add flag(s) to existing flags
Sub Remove flags from file
All Change all files
Quiet No outputExample: Protect Editor rwed
Quit Format: Quit RC/NPurpose: Quit a script with optional return codeParameters:
RC Return CodeExample: Quit 5
Relabel Format: Relabel Drive/A Name/APurpose: Change name of a diskParameters:
Drive Disk to change
Name New volume nameExample: Relabel DH2: Documents
Rename Format: Rename From/A/M To=As/A QUIET/SPurpose: Rename or move one or more filesParameters:
From Old filename
To|As New filename
Quiet No outputExample: Rename MyDoc as MyDoc.doc
RequestChoice Format: RequestChoice Title/A Body/A Gadgets/M PubScreen/KPurpose: Asks for input via a requesterParameters:
Title Title for dialog box
Body Text for dialog box
Gadgets List of buttons
Pubscreen Screen to useExample: RequestChoice >ENV:RT "Format" "About to format your hard disk*nAre you sure?" "Go ahead" "No way!"
RequestFile Format: RequestFile Drawer File/K Pattern/K Title/K Positive/K Negative/K AcceptPattern/K RejectPattern/K SAVEMODE/S MULTISELECT/S DRAWERSONLY/S NOICONS/S PUBSCREEN/KParameters:
Drawer Initial drawer to use,
File Initial file name,
Pattern Use pattern as filter,
Title Title of dialog box,
Positive Text for OK button,
Negative Text for Cancel button,
AcceptPattern Defines file pattern(s) to show (overrides Pattern),
RejectPattern Pattern(s) of files to hide,
SaveMode Change colours to indicate Save or other mode,
MultiSelect Allow multiple file selection,
DrawersOnly Display only directories,
NoIcons Suppress info files,
PubScreen Screen to use.Purpose: Asks for a filename via ASL file requesterExample: RequestFile >ENV:File Title "Select a File" Positive "Load" Noicons
Resident Format: Resident Name File REMOVE/S ADD/S REPLACE/S PURE=FORCE/S SYSTEM/SPurpose: Stores AmigaDOS command in memory (quicker than reloading from disk each time it is executed). To ensure a command can be made resident check the pure flag (see List).Parameters:
Name|File File to be made resident,
Remove Remove file from resident list,
Add Add file to resident memory,
Pure|Force Force a non-pure file to be resident,
System Show system's resident code segments.Example: Resident C:Dir Pure
Run Format: Run Command/FPurpose: Execute a program in the background (multi-task)Parameters:
Command Program to runExample: Run DirectoryOpus > NIL:
Search Format: Search From/M Search/A ALL/S NONUM/S QUIET/S QUICK/S FILE/S PATTERN/SPurpose: Search for a string in a file or a file on a diskParameters:
From Directory to search from,
Search Text to search for,
All Search sub-directories,
NoNum Line numbers are not displayed,
Quiet No Output,
Quick Reduce output listing,
File Search a file rather than content,
Pattern Search using a pattern.Example: Search SYS: "List" File All
Set Format: Set Name String/FPurpose: Sets or lists a local environment variable (local to current shell or current process)Parameters:
Name Variable name,
String Text or number for variableExample: Set MyName "Peter"
SetClock Format: Setclock LOAD/S SAVE/S RESET/SPurpose: Load or set the date and time from battery-backed clockParameters:
Load Load date from clock
Save Save date and time to clock
Reset Resets the clickExample: Date 27-Nov-00 10:00, SetClock Save
SetDate Format: Setdate File/A Weekday Date Time ALL/SPurpose: Set date of a file or directory (see List)Parameters:
File File to change,
Weekday Day of week,
Date Date,
Time Time,
All All filesExample: Setdate DEVS: Monday 10:30
Setenv Format: Setenv Name String/FPurpose: Change the contents of a environment variableParameters:
Name Variable name
String Text or number for variableExample: Setenv Wanderer "44"
SetKeyboard Format: Setkeyboard Keymap/APurpose: Sets keyboard layout using layouts in Devs:Keymaps. You can use the Input preferences instead.Parameters:
Keymap Keymap file to useExample: SetKeyboard USA0
Skip Format: Skip Label BACK/SPurpose: Jump to a label in a script (see Lab). Use back if label occurs before Skip command.Parameters:
Label Label name to skip to,
Back Go back in script to labelExample: Skip Lab2 Back
Sort Format: Sort From/A To/A Colstart/K CASE/S NUMERIC/SPurpose: Sort a file and output to new fileParameters:
From File to sort, To = Output file, Colstart = Column to sort from,
Case Upper case entries are done first,
Numeric Input treated as numbers.Example: Sort Figures To SortedFigures Numeric
Stack Format: Stack Size/NPurpose: Change/display amount of stack space in bytes.Parameters:
Size Stack size in bytesExample: Stack 1000000
Status Format: Status Process/N FULL/S TCB/S CLI=ALL/S COM=COMMAND/KPurpose: Display status of running programs. TCB is Task Control BlockParameters:
Process Task number
Full Full output of process info
TCB Information except the command name
CLI|All Command info only
COM|Command Search for commandExample: Status 2 Full
Type Format:N/K HEX/S NUMBER/SPurpose: Display contents of text file on screen and binary files using HEX with optional line numbers.Parameters:
From Text file to display
To Output file or device
Opt H | Hex Display as hex values
Opt N | Number Number the lines.Example: Type C:DIR HEX
Unset Format: Unset NamePurpose: Remove a local env variableParameters:
Name Environment variable nameExample: Unset MyName
Unsetenv Format: Unsetenv NamePurpose: Remove a global env variableParameters:
Name Environment variable nameExample: Unsetenv Wanderer
Unalias Format: Unalias NamePurpose: Remove a short name for a commandParameters:
Name Alias nameExample: UnAlias MyDir
Version Format: Version Name Version/N Revision/N FILE/S FULL/S Unit/N INTERNAL/S RES/SPurpose: Display workbench, library or device version information.Parameters:
Name File
Version Print Kickstart or Workbench number and sets env variables and sets Warn flag
Revision As Version but for Revision numer, File = Check file rather than memory
Full Display full information,
Internal Check internal files,
Res Check resident files.Example: Version kickstart Version=39 Revision=106
Wait Format: Wait Time/N SEC=SECS/S MIN=MINS/S UNTIL/KPurpose: Wait for a specified period of timeParameters:
Time Time period in either Sec (Seconds) or Mins (Minutes)
Until Wait until a timeExample: Wait Until 12:00
Which Format: Which File/A NORES/S RES/S ALL/SPurpose: Find where a file is in command path (see Path) and sets Warn flag.Parameters:
File File to locate
NoRes Resident list is not searched
Res Only the resident list is searched
All Search full pathExample: Which Multiview
Why Format: WhyPurpose: Display reason why a previous command failedExample: Why
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> <NOPRETEND> <NOLOG> <NOPRINT>
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] <command> <archive[.LZH|LHA]> [[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] <command> <archive> [<file> ...] [<destdir>]
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')
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"
*E[>1m
Is a so called SGR command that omits the first few parameters. It turns BOLD ON.
*E[1;37;41m%n.%s>
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[0;32;41m
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;0H
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[J
command 'erase in display' (no additional parameters used in this command).
;Set MagicWB colors in AROS
setpencolor SCREEN="Workbench" PEN=0 COLOR=$959595
setpencolor SCREEN="Workbench" PEN=3 COLOR=$A2673B
setpencolor SCREEN="Workbench" PEN=4 COLOR=$7B7B7B
setpencolor SCREEN="Workbench" PEN=5 COLOR=$AFAFAF
setpencolor SCREEN="Workbench" PEN=6 COLOR=$7C90AA
setpencolor SCREEN="Workbench" PEN=7 COLOR=$97A9FF
DOS commands only present in AROS
AddAudioModes Format:Purpose:Parameters: Files/M Quiet/S Refresh/S Remove/S DblScan/SExample:
Beep Format:Purpose:Parameters:Example:
CheckMem Format:Purpose:Parameters:Example:
Delay Format:Purpose:Parameters: Time/N Tick=Ticks/SExample:
DevList Format: DevListPurpose: gives a list of devices running - address, version, revision, opencnt, flags, nameParameters:Example: devlist
LibList Format: LibListPurpose: gives address, version, revision, opencnt, flags, name of open libraries and muiParameters:Example: liblist
Reboot Format: RebootPurpose: warm reboots machine - not functioningParameters:Example:
ResList Format: reslistPurpose: gives a list of resources - name and addressParameters:Example: reslist
Shutdown Format: shutdownPurpose: power off computerParameters:Example: not functioning
TaskList Format: tasklistPurpose: gives a list of tasks running - address, type, priority, state, cpu, time, stack, used, nameParameters:Example: tasklist
Examples