ChucK/Dev/Shell/doc
From CSWiki
Contents |
[edit]
Introduction
The ChucK shell provides a simple, built-in way to add and modify programs on-the-fly and to manage ChucK sessions.
[edit]
Command Line Options
[edit]
--shell
Opens ChucK shell and starts the virtual machine.
[edit]
--empty
Opens a ChucK shell without a virtual machine.
[edit]
Command Summary
- shell commands
- Shred Management
-
add [files]or+ [files]- adds [files] to current VM and prints out a shred reference number for each file
-
remove [ids]or- [ids] -
removeall -
replace id filename [id filename]... -
--(remove shred with highest id) -
statusor^
-
- Shell Management
-
ls(like unix ls) -
aliasandunalias(simple substitution-based, bash-like command aliases) -
shredslist all shreds on the current VM -
pwd -
cd(change directory, also change current dir for chuck so paths are consistent) -
closeclose down shell, keep process VM running -
exitexit everything
-
- Virtual Machine Management
-
vm attach [hostname[:port]]orvm @ [hostname[:port]]attempts to attach to a ChucK VM running on hostname:port. The default port is 8888. If no hostname or port is specified, the shell attempts to attach to the in-process VM- prints a success message and the VM reference number for each successful attachment; prints a failure message for each failed attachment
-
vm +orvm add- saves the current VM for later use
-
vm - [vm_reference]orvm remove [vm_reference]- removes specified VM--it is no longer on the VM list
-
vm = [vm_reference]orvm swap [vm_reference] -
vmsorvm list- lists all VMs plus the current VM
-
vm @+ hostname:portadds and attaches the specified VM -
killkills the current vm--shuts down the shell too if current_vm is the process vm
-
[edit]
Inline Coding
-
{ [code] }addscodeto the current VM- A
{ }block can be stretched out over a number of lines - if so, the shell prompt will change to
codeand will also print the current scope level of the code entry. Also, the code entry will be considered complete when the shell finds a matching brace for the first opening brace - If an alphannumeric text string is supplied after the final brace, the code will be saved within the shell and will be associated with that particular name. Non-CR/LF whitespace may separate the brace and the code name.
- example:
{ 0 => int i; } foowill be saved as 'foo'
- example:
- A
-
code list [code_name] -
code print [code_name] -
code save code_namesaves last code entry as code_name -
code delete code_name -
code add code_nameadds code_name to current VM -
code write code_name filewrites code_name to file -
code read code_name filereads code in file to code_name
[edit]
Tutorial 1
[edit]
