# -*- merd -*- # hello world # print a simple string on stdout "Hello World".println # argv # access command line parameters (no segmentation fault accepted, nor silent exception, so some languages must explicitly check the presence of the argument) Sys::args[0].println # env # access environment variable Sys::env{"HOME"}.println # test file exists # return exit code error (non zero) if a file does not exist Sys::exit(1) if not File::exists?("/etc/mtab") # test file readable # return exit code error (non zero) if a file is not readable File::open("/etc/mtab") or Sys::exit(1) # formatting # print integers in a simple formatted string a=1; b=2; "{a} + {b} = {a + b}".println # system # call an external program and check the return value Sys::system("false") or warn("false failed"); Sys::system("echo done")