Difference between revisions of "Shell.aliases"

From ComputerCraft Wiki
Jump to: navigation, search
Line 8: Line 8:
 
|examples=
 
|examples=
 
{{Example
 
{{Example
|desc=This code will return all set aliases
+
|desc=This code will return all set aliases and the programs they refer to.
|code= for k,v in pairs(shell.aliases()) do<br/>  print(v)<br/>end
+
|code= for k,v in pairs(shell.aliases()) do<br/>  print(k.." : "..v)<br/>end
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:API_Functions]]
 
[[Category:API_Functions]]

Revision as of 12:36, 3 May 2013


Grid Redstone.png  Function shell.aliases
Returns a table containing the default aliases and user specified aliases
Syntax shell.aliases()
Returns A table containing default and set aliases.
Part of ComputerCraft
API Shell

Examples

Grid paper.png  Example
This code will return all set aliases and the programs they refer to.
Code
for k,v in pairs(shell.aliases()) do
print(k.." : "..v)
end