Hello World!

Here's how to use Machine Configuration Manager (MCM) for a simple "Hello World" example:

  1. Install MCM (see Installing MCM if MCM isn't already installed)
  2. Create a file called HelloWorld.mcm with the following content. Note that MCM is strict about whitespace, so be careful not to convert the tabs at the beginning of the indented lines to spaces or to add extra spaces/tabs.
    MCM HelloWorld
    
    define helloWorld()
    	File path> /helloworld.txt
    		content: Hello World!
    
  3. Invoke mcm on our example and check the results:
    > mcm -r build -f promptunlessonlyadditions HelloWorld.helloWorld
    mkdir build
    install build/helloworld.txt
    Enacting...
    > cat build/helloworld.txt
    Hello World!
    
  4. If your editor supports UTF-8 (most do) and you have some Chinese fonts installed then create a file called 世界你好.mcm to say shìjièWorldhǎoHello with the following content:
    MCM 世界你好
    
    define helloWorld()
    	File path> /helloworld.txt
    		content: Hello World!
    
    define 世界你好()
    	File content> 世界你好! path> /世界你好.txt
    
  5. And invoke mcm on this second example and check the results:
    > mcm -r build -f promptunlessonlyadditions 世界你好.世界你好
    mkdir build
    install build/世界你好.txt
    Enacting...
    > cat build/世界你好.txt
    世界你好!