Aros/User/DOS
The AROS shell
[edit | edit source]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
[edit | edit source]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
[edit | edit source]http://uk.aminet.net/docs/help/adosbegin.lha
http://se.aminet.net/pub/aminet/docs/help/adosbegin.lha
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".
Escape Codes
[edit | edit source]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).
Drives, Files, Assigns, Directories
[edit | edit source]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
[edit | edit source]- 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"
[edit | edit source]
SYS:
Extras:
DEVS:
Development:
L:
S:
LIBS:
C:
ENV:
RAM:
ENVARC:
MUI:
T:
Directories and files
[edit | edit source]SYS:Prefs
[edit | edit source]...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
[edit | edit source]...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
[edit | edit source]...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
[edit | edit source]...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
[edit | edit source]...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
[edit | edit source]...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
[edit | edit source]Key | desc |
---|---|
/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/N |
Purpose: | Add memory to disk buffers to improve speed. |
Parameters: |
|
Example: | Addbuffers DH0: 10 |
AddDatatypes | |
---|---|
Format: | AddDataTypes files/M QUIET/S REFRESH/S LIST/S |
Purpose: | Activates datatypes or adds another datatype if not detected at startup |
Parameters: |
|
Example: | AddDataTypes gif.datatype REFRESH |
Alias | |
---|---|
Format: | Alias Name String/F |
Purpose: | Assigns a short name to a dos command. |
Parameters: |
|
Example: | Alias Del Delete |
Ask | |
---|---|
Format: | Ask Prompt/A |
Purpose: | Asks a question in a script (reply y/n). Use IF WARN to test for a yes (value 5). |
Parameters: |
|
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/S | |
Purpose: | Assign names to directory paths. |
Parameters: |
|
Example: | Assign Development: Extras:bin |
Avail | |
---|---|
Format: | Avail CHIP/S FAST/S TOTAL/S FLUSH/S |
Purpose: | Memory availability |
Parameters: |
|
Example: | Avail TOTAL |
Break | |
---|---|
Format: | Break Process/A/N ALL/S C/S D/S E/S F/S |
Purpose: | Stop a program (see Status) |
Paramters: |
|
Example: | Break 2 C |
CD | |
---|---|
Format: | CD Dir/A |
Purpose: | Change directory |
Parameters: |
|
Example: | CD Text_Files |
ChangeTaskPri | |
---|---|
Format: | ChangeTaskPri Pri=Priority/A/N Process/K/N |
Purpose: | Changes program's execution priority (see Status) |
Parameters: |
|
Example: | ChangeTaskPri 2 1 |
Conclip | |
---|---|
Format: | Conclip Unit/N OFF/S |
Purpose: | Activates clipboard device |
Parameters: |
|
Example: | 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/S |
Purpose: | Copy files (with/without protection bits) |
Parameters: |
|
Example: | Copy mydoc.txt docs: Dates |
Date | |
---|---|
Format: | Date Day Date Time To=Ver/K |
Purpose: | Display/change date or time |
Parameters: |
|
Example: | Date To=date.txt |
Delete | |
---|---|
Format: | Delete File/M/A ALL/S QUIET/S FORCE/S |
Purpose: | Delete files and/or directories. |
Parameters: |
|
Example: | Delete OldFilesDir All |
Dir | |
---|---|
Format: | Dir Dir Opt/K ALL/S DIRS/S FILES/S INTER/S |
Purpose: | List contents of a directory |
Parameters: |
|
Example: | Dir S: Files |
Diskchange | |
---|---|
Format: | Diskchange Device/A |
Purpose: | Tell Dos that a disk has been swapped in a non-autosensing disk drive. |
Parameters: |
|
Example: | Diskchange DU2: |
Echo | ||
---|---|---|
Format: | Echo String/M NOLINE/S FIRST/K/N LEN/K/N TO/K | |
Purpose: | Display text in a script or part of a string of text. | |
Parameters: |
| |
Example: | Echo "Enter your name: " NoLine |
Else | |
---|---|
Format: | Else |
Purpose: | Used with IF, if not true do these commands |
Example: |
|
EndCLI | |
---|---|
Format: | EndCLI |
Purpose: | Close CLI console window |
Example: | EndCLI |
Endif | |
---|---|
Format: | Endif |
Purpose: | End a IF..ELSE..ENDIF block |
Example: | If $Age GT 65
Else Endif |
Endskip | |
---|---|
Format: | Endskip |
Purpose: | Stops a SKIP branch (for debugging) |
Example: | Endskip |
Eval | |
---|---|
Format: | Eval Value1/A Op Value2/M To/K LFormat/K |
Purpose: | Evaluate a simple arithmetic expression |
Parameters: |
|
Example: | Eval $count + 1 to env:count |
Execute | |
---|---|
Format: | Execute File/A |
Purpose: | Execute a script or batch file |
Parameters: |
|
Example: | Execute PCD |
Failat | |
---|---|
Format: | Failat RCLIM/A |
Purpose: | Change failure limit for scripts (0,5,10,20) |
(0 - Ok, 5 - Warn, 10 - Error, 20 - Fail) | |
Parameters: |
|
Example: | Failat 20 |
Fault | |
---|---|
Format: | Fault Error/N/M |
Purpose: | Display error message from a code |
Parameters: |
|
Example: | Fault 221 |
"Fault 221: Disk is full" |
FileNote | |
---|---|
Format: | Filenote File/A Comment ALL/S QUIET/S |
Purpose: | Attach a comment to a file (see LIST) |
Parameters: |
|
Example: | 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/S | |
Purpose: | Initialises AROS disks (in System drawer) |
Parameters: |
|
Example: | format drive dh0: name AROS
Format Drive DH2: Name Docs SFS NOICONS QUICK |
Get | |
---|---|
Format: | Get Name/A |
Purpose: | Returns contents of local env variable |
Parameters: |
|
Example: | Get RC |
Getenv | |
---|---|
Format: | Getenv Name/A |
Purpose: | Return contents of a global environment variable |
Parameters: |
|
Example: | Getenv Wanderer |
Iconx | |
---|---|
Format: | Iconx |
Purpose: | 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/K |
Purpose: | If condition is true execute following commands until an ELSE or ENDIF occurs. |
Parameters: |
|
Example: | IF WARN, IF $count GT 10, IF EXISTS C:List |
Info | |
---|---|
Format: | Info Device |
Purpose: | Displays information about disks |
Parameters: |
|
Example: | Info DH0: |
Install | |
---|---|
Format: | Install Device/A NOBOOT/S CHECK/S FFS/S |
Purpose: | 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: |
|
FFS = Use Fast File System. | |
Example: | Install DH0: |
IPrefs | |
---|---|
Format: | IPrefs |
Purpose: | Initialises preferences files on startup. |
Example: | IPrefs |
Join | |
---|---|
Format: | Join File/M/A AS=TO/K/A |
Purpose: | Join two or files together. |
Parameters: |
|
Example: | Join File1 File2 File3 as FileFull |
Lab | |
---|---|
Format: | Lab Label |
Purpose: | State a Label to Skip to in a script |
Parameters: |
|
Example: | 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/S | |
Purpose: | List file details in a directory. |
Parameters: |
|
Example: | List Development: Block Dates Since=01-Jul-00 |
Lock | |
---|---|
Format: | Lock Drive/A ON/S OFF/S Passkey |
Purpose: | Lock a device from writing. |
Parameters: |
|
Example: | Lock DH1: On GHK459 |
MakeDir | |
---|---|
Format: | Makedir Name/M |
Purpose: | Create one or more new directories. |
Parameters: |
|
Example: | MakeDir DH1:Docs DH1:Basic DH0:TempFiles |
MakeLink | |
---|---|
Format: | MakeLink From/A To/A HARD/S FORCE/S |
Purpose: | Creates a logical link between files |
Parameters: |
|
Example: | MakeLink T C:Type Hard |
Mount | |
---|---|
Format: | Mount Device/M From/K |
Purpose: | Loads and mount a device |
Parameters: |
|
Example: | Mount DEVS:CD0 |
NewShell | |
---|---|
Format: | NewShell Window From |
Purpose: | Open a new Shell console (CON) window |
Parameters: |
|
Example: | NewShell From S:Shell-Startup |
Path | |
---|---|
Format: | Path Path/M ADD/S SHOW/S RESET/S REMOVE/S QUIET/S |
Purpose: | Set or change the program search path |
Parameters: |
|
Example: | Path SC:C Add |
Prompt | |
---|---|
Format: | Prompt Prompt |
Purpose: | Change the prompt text (Codes: %R = last return code, |
%S = Current path, %N = CLI Number) | |
Parameters: |
|
Example: | Prompt "%N.%S> " |
Protect | |
---|---|
Format: | Protect File/A Flags ADD/S SUB/S ALL/S QUIET/S |
Purpose: | Change the 'rwedsp' flags of a file. (r=read,w=write, e=execute,d=delete,s=script,p=pure) |
Parameters: |
|
Example: | Protect Editor rwed |
Quit | |
---|---|
Format: | Quit RC/N |
Purpose: | Quit a script with optional return code |
Parameters: |
|
Example: | Quit 5 |
Relabel | |
---|---|
Format: | Relabel Drive/A Name/A |
Purpose: | Change name of a disk |
Parameters: |
|
Example: | Relabel DH2: Documents |
Rename | |
---|---|
Format: | Rename From/A/M To=As/A QUIET/S |
Purpose: | Rename or move one or more files |
Parameters: |
|
Example: | Rename MyDoc as MyDoc.doc |
RequestChoice | |
---|---|
Format: | RequestChoice Title/A Body/A Gadgets/M PubScreen/K |
Purpose: | Asks for input via a requester |
Parameters: |
|
Example: | 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/K | |
Parameters: |
|
Purpose: | Asks for a filename via ASL file requester |
Example: | 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/S |
Purpose: | 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: |
|
Example: | Resident C:Dir Pure |
Run | |
---|---|
Format: | Run Command/F |
Purpose: | Execute a program in the background (multi-task) |
Parameters: |
|
Example: | Run DirectoryOpus > NIL: |
Search | |
---|---|
Format: | Search From/M Search/A ALL/S NONUM/S QUIET/S QUICK/S FILE/S PATTERN/S |
Purpose: | Search for a string in a file or a file on a disk |
Parameters: |
|
Example: | Search SYS: "List" File All |
Set | |
---|---|
Format: | Set Name String/F |
Purpose: | Sets or lists a local environment variable (local to current shell or current process) |
Parameters: |
|
Example: | Set MyName "Peter" |
SetClock | |
---|---|
Format: | Setclock LOAD/S SAVE/S RESET/S |
Purpose: | Load or set the date and time from battery-backed clock |
Parameters: |
|
Example: | Date 27-Nov-00 10:00, SetClock Save |
SetDate | |
---|---|
Format: | Setdate File/A Weekday Date Time ALL/S |
Purpose: | Set date of a file or directory (see List) |
Parameters: |
|
Example: | Setdate DEVS: Monday 10:30 |
Setenv | |
---|---|
Format: | Setenv Name String/F |
Purpose: | Change the contents of a environment variable |
Parameters: |
|
Example: | Setenv Wanderer "44" |
SetKeyboard | |
---|---|
Format: | Setkeyboard Keymap/A |
Purpose: | Sets keyboard layout using layouts in Devs:Keymaps. You can use the Input preferences instead. |
Parameters: |
|
Example: | SetKeyboard USA0 |
Skip | |
---|---|
Format: | Skip Label BACK/S |
Purpose: | Jump to a label in a script (see Lab). Use back if label occurs before Skip command. |
Parameters: |
|
Example: | Skip Lab2 Back |
Sort | |
---|---|
Format: | Sort From/A To/A Colstart/K CASE/S NUMERIC/S |
Purpose: | Sort a file and output to new file |
Parameters: |
|
| |
Example: | Sort Figures To SortedFigures Numeric |
Stack | |
---|---|
Format: | Stack Size/N |
Purpose: | Change/display amount of stack space in bytes. |
Parameters: |
|
Example: | Stack 1000000 |
Status | |
---|---|
Format: | Status Process/N FULL/S TCB/S CLI=ALL/S COM=COMMAND/K |
Purpose: | Display status of running programs. TCB is Task Control Block |
Parameters: |
|
Example: | Status 2 Full |
Type | |
---|---|
Format: | N/K HEX/S NUMBER/S |
Purpose: | Display contents of text file on screen and binary files using HEX with optional line numbers. |
Parameters: |
|
Example: | Type C:DIR HEX |
Unset | |
---|---|
Format: | Unset Name |
Purpose: | Remove a local env variable |
Parameters: |
|
Example: | Unset MyName |
Unsetenv | |
---|---|
Format: | Unsetenv Name |
Purpose: | Remove a global env variable |
Parameters: |
|
Example: | Unsetenv Wanderer |
Unalias | |
---|---|
Format: | Unalias Name |
Purpose: | Remove a short name for a command |
Parameters: |
|
Example: | UnAlias MyDir |
Version | |
---|---|
Format: | Version Name Version/N Revision/N FILE/S FULL/S Unit/N INTERNAL/S RES/S |
Purpose: | Display workbench, library or device version information. |
Parameters: |
|
| |
Example: | Version kickstart Version=39 Revision=106 |
Wait | |
---|---|
Format: | Wait Time/N SEC=SECS/S MIN=MINS/S UNTIL/K |
Purpose: | Wait for a specified period of time |
Parameters: |
|
Example: | Wait Until 12:00 |
Which | |
---|---|
Format: | Which File/A NORES/S RES/S ALL/S |
Purpose: | Find where a file is in command path (see Path) and sets Warn flag. |
Parameters: |
|
Example: | Which Multiview |
Why | |
---|---|
Format: | Why |
Purpose: | Display reason why a previous command failed |
Example: | Why |
Additional DOS commands
[edit | edit source]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
[edit | edit source]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')
DOS commands only present in AROS
[edit | edit source]AddAudioModes | |
---|---|
Format: | |
Purpose: | |
Parameters: | Files/M Quiet/S Refresh/S Remove/S DblScan/S |
Example: |
Beep | |
---|---|
Format: | |
Purpose: | |
Parameters: | |
Example: |
CheckMem | |
---|---|
Format: | |
Purpose: | |
Parameters: | |
Example: |
Delay | |
---|---|
Format: | |
Purpose: | |
Parameters: | Time/N Tick=Ticks/S |
Example: |
DevList | |
---|---|
Format: | DevList |
Purpose: | gives a list of devices running - address, version, revision, opencnt, flags, name |
Parameters: | |
Example: | devlist |
LibList | |
---|---|
Format: | LibList |
Purpose: | gives address, version, revision, opencnt, flags, name of open libraries and mui |
Parameters: | |
Example: | liblist |
Reboot | |
---|---|
Format: | Reboot |
Purpose: | warm reboots machine - not functioning |
Parameters: | |
Example: |
ResList | |
---|---|
Format: | reslist |
Purpose: | gives a list of resources - name and address |
Parameters: | |
Example: | reslist |
Shutdown | |
---|---|
Format: | shutdown |
Purpose: | power off computer |
Parameters: | |
Example: | not functioning |
TaskList | |
---|---|
Format: | tasklist |
Purpose: | gives a list of tasks running - address, type, priority, state, cpu, time, stack, used, name |
Parameters: | |
Example: | tasklist |
Examples
[edit | edit source]Is there a way to unzip more say 10 zipped archived at a time
list #?.zip lformat "unzip %N" >script
execute script
Resident >NIL: C:RequestChoice PURE
Resident >NIL: C:RequestFile PURE
; $VER: DMSMaker v1.0 (11.7.96) Richard Burke
lab Start
if EXISTS ENV:Choice
delete ENV:Choice >NIL:
endif
if EXISTS ENV:Tst
delete ENV:Tst >NIL:
endif
if EXISTS ENV:V
delete ENV:V >NIL:
endif
if EXISTS ENV:Re
delete ENV:Re >NIL:
endif
if EXISTS ENV:DMS
delete ENV:DMS >NIL:
endif
if EXISTS ENV:De
delete ENV:De >NIL:
endif
if EXISTS ENV:DeDev
delete ENV:DeVol >NIL:
endif
if EXISTS ENV:Cr
delete ENV:Cr >NIL:
endif
if EXISTS ENV:CrSv
delete ENV:CrSv >NIL:
endif
if EXISTS ENV:Mode
delete ENV:Mode >NIL:
endif
if EXISTS ENV:Mode1
delete ENV:Mode1 >NIL:
endif
which DMS all >ENV:DMS
RequestChoice >ENV:Choice "Welcome!" "Welcome to the DMSMaker! Choose an action" "Crunch" "Decrunch" "Repack" "View" "Test" "Quit"
if $Choice EQ 1
lab Dev
RequestFile >ENV:Cr DRAWERSONLY TITLE "Choose DEVICE to crunch" POSITIVE "Crunch" NEGATIVE "Return to menu"
if WARN
skip Start BACK
endif
if NOT EXISTS $Cr
echo "DEVICE does not exist! Choose again!"
skip Dev BACK
endif
RequestChoice >ENV:Mode1 "Crunch Mode" "Choose degree of crunching" "Best" "None" "Heavy1" "Heavy2" "Return to menu"
if WARN
skip Start BACK
endif
if $Mode1 EQ 1
echo "BEST" >ENV:Mode
endif
if $Mode1 EQ 2
echo "NONE" >ENV:Mode
endif
if $Mode1 EQ 3
echo "HEAVY1" >ENV:Mode
endif
if $Mode1 EQ 4
echo "HEAVY2" >ENV:Mode
endif
RequestFile >ENV:CrSv TITLE "Save crunched file as..." ACCEPTPATTERN "#?.dms" FILE ".dms" POSITIVE "Save" NEGATIVE "Return to menu"
if WARN
skip Start BACK
endif
$DMS read $CrSv FROM $Cr CMODE $Mode
echo "File crunched!"
endif
if $Choice EQ 2
lab Dec
RequestFile >ENV:De TITLE "Choose FILE to decrunch" ACCEPTPATTERN "#?.dms" POSITIVE "Decrunch" NEGATIVE "Return to menu"
if WARN
skip Start BACK
endif
if NOT EXISTS $De
echo "FILE does not exist! Choose again!"
skip Dec BACK
endif
lab DecDev
RequestFile >ENV:DeDev TITLE "Choose DEVICE to decrunch TO" DRAWERSONLY POSITIVE "Write" NEGATIVE "Return to menu"
if WARN
skip Start BACK
endif
if NOT EXISTS $DeDev
echo "DEVICE does not exist! Choose again!"
skip DecDev BACK
endif
$DMS write $De TO $DeDev
echo "File decrunched!"
endif
if $Choice EQ 3
lab Rep
RequestFile >ENV:Re TITLE "Choose FILE to repack" ACCEPTPATTERN "#?.dms" POSITIVE "Repack" NEGATIVE "Return to menu" FILE ".dms"
if WARN
skip Start BACK
endif
if NOT EXISTS $Re
echo "File does not exist! Choose again!"
skip Rep BACK
endif
RequestChoice >ENV:Mode1 "Crunch Mode" "Choose degree of crunching" "Best" "None" "Heavy1" "Heavy2" "Return to menu"
if WARN
skip Start BACK
endif
if $Mode1 EQ 1
echo "BEST" >ENV:Mode
endif
if $Mode1 EQ 2
echo "NONE" >ENV:Mode
endif
if $Mode1 EQ 3
echo "HEAVY1" >ENV:Mode
endif
if $Mode1 EQ 4
echo "HEAVY2" >ENV:Mode
endif
RequestFile >ENV:CrSv TITLE "Save repacked file as..." ACCEPTPATTERN "#?.dms" FILE ".dms" POSITIVE "Save" NEGATIVE "Return to menu"
if WARN
skip Start BACK
endif
$DMS repack $Re TO $CrSv CMODE $Mode
echo "File repacked!"
endif
if $Choice EQ 4
lab View
RequestFile >ENV:V TITLE "Choose DMS FILE to view" POSITIVE "View" NEGATIVE "Return to menu" ACCEPTPATTERN "#?.dms" FILE ".dms"
if WARN
skip Start BACK
endif
if NOT EXISTS $V
echo "FILE does not exist! Choose again!"
skip View BACK
endif
$DMS view $V
endif
if $Choice EQ 5
lab Test
RequestFile >ENV:Tst TITLE "Choose FILE to test" ACCEPTPATTERN "#?.DMS" POSITIVE "Test" NEGATIVE "Return to menu" FILE ".dms"
if WARN
skip Start BACK
endif
if NOT EXISTS $Tst
echo "FILE does not exist! Choose again!"
skip Test BACK
endif
$DMS test $Tst
endif
if $Choice EQ 0
skip End
endif
skip Start BACK
lab End
quit
resident >nil: c:search PURE
resident >nil: c:requestfile PURE
resident >nil: c:requestchoice PURE
resident >nil: c:echo PURE
resident >nil: c:copy PURE
resident >nil: c:type PURE
; $VER: HappySearch v1.0 (25.4.97) Richard Burke
requestchoice >env:int "HappySearch" "HappySearch searches the specified device/drawer*nto see if any files have been infected with the*n'Happy New Year 96!' virus, and informs of any*ninfected files it finds. Such files will have the*nvirus name printed below them in the scanned file*nlisting." "Okay" "Quit"
if $int EQ 0
quit
endif
lab beg
if exists env:mo
delete >nil: env:mo
endif
if exists env:disp
delete >nil: env:disp
endif
if exists env:dev
delete >nil: env:dev
endif
if exists env:hap
delete >nil: env:hap
endif
if exists env:sav1
delete >nil: env:sav1
endif
if exists env:rec
delete >nil: env:rec
endif
if exists env:sav
delete >nil: env:sav
endif
if exists env:int
delete >nil: env:int
endif
requestfile >env:dev TITLE "Choose drawer to search:" POSITIVE Search DRAWERSONLY
if warn
quit
endif
requestchoice >env:disp "Save?" "Results will be printed to screen.*nSave results to file too?*n(This is recommended)" "Yes" "No"
if $disp EQ 1
requestfile >env:sav TITLE "Location:" POSITIVE Save DRAWER RAM: FILE Happy.tmp
echo $sav >env:sav1
endif
requestchoice >env:rec "Recurse?" "Search sub-directories recursively?" "Yes" "No"
if $rec EQ 1
echo "Scanning files . . ."
search $dev "Happy New Year 96!" ALL >env:hap
else
echo "Scanning files . . ."
search $dev "Happy New Year 96!" >env:hap
endif
echo "Files scanned:"
type env:hap
if $disp EQ 0
delete >nil: env:hap
else
copy >nil: env:hap $sav1
echo "File listing saved as *e[33m$sav1*e[0m"
endif
requestchoice >env:mo "More?" "Scan another drawer?" "Yes" "No"
if $mo EQ 1
skip beg back
endif
if exists env:mo
delete >nil: env:mo
endif
if exists env:disp
delete >nil: env:disp
endif
if exists env:dev
delete >nil: env:dev
endif
if exists env:hap
delete >nil: env:hap
endif
if exists env:sav1
delete >nil: env:sav1
endif
if exists env:rec
delete >nil: env:rec
endif
if exists env:sav
delete >nil: env:sav
endif
if exists env:int
delete >nil: env:int
endif
quit