Skip to main content
  1. Lumesh Document/

Script Writing

117 words·1 min
Table of Contents

Interpreter Declaration
#

The first line of a script file typically contains the interpreter declaration. The recommended shebang is #!/usr/bin/env lumesh.

There are two binary files available for download: lume or lume-se. You can link one of them to lumesh based on your preference.

1ln -sf /usr/bin/lume /usr/bin/lumesh     # or
2ln -sf /usr/bin/lume-se /usr/bin/lumesh

Scripts without a shebang line can only be run using lume my.lm. Scripts with a shebang line can be executed directly with my.lm.

File Extension
#

The recommended file extension is .lm.

Example
#

 1#!/usr/bin/env lumesh
 2
 3fn add(msg, *salaries){
 4    println msg.green()
 5    println salaries.sum()
 6}
 7
 8add('wang fang', 4500, 5000, 6100)
 9
10if argv.len() {
11    println 'Your args:' argv
12}

Related