Prev: A Sample Script
A Sample Shell Session
Besides running stored scripts, you can also execute
m interactively, for instance as a powerful calculator, or to manipulate data on your phone you cannot easily access otherwise.
To open an interactive shell, select . The shell console will prompt you for a command with m>.
After the prompt, enter the following calculation, then
| Series 60: | Press the confirm button. |
| UIQ: | Press the button. |
14 / (14 + 3)
→ 0.8235294118
|
 | |  |
| Series 60 sample screen | | UIQ sample screen |
Or print a table of EUR versus USD:
rate=1.22;
for eur=10 to 50 by 5 do
print eur,'EUR',rate*eur,'USD'
end
→ 10 EUR 12.2 USD
15 EUR 18.3 USD
20 EUR 24.4 USD
25 EUR 30.5 USD
...
|
Interactive shells can execute arbitrary m code, including variable assignments, function declarations, module imports and so on. In addition, there are some useful functions to manipulate files:
| cd | Display and change current directory. |
| cls | Clear the console output. |
| cp | Copy files. |
| del | Delete files. |
| dir | List directories. |
| md | Create directories. |
| mv | Move files. |
| rd | Remove directories. |
| ren | Rename a file. |
| send | Send a file ("Send As"). |
| type | Display text file contents. |
For instance, the following command searches the C: drive for JPEG (.jpg) files (/r indicates that all subdirectories should also be searched):
dir c:\*.jpg/r
→ c:\Nokia\Images\Backgrounds\mShellLogo.jpg
...
|
See also chapter * (Reference) for more information about interactive shells.
Next: The m Application© 2004-2011 airbit AG, CH-8008 Zürich
Document AB-M-TUT-887