Here's how to use Machine Configuration Manager (MCM) for a simple "Hello World" example:
- Install MCM (see Installing MCM if MCM isn't already installed)
- 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!
- 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!
- If your editor supports UTF-8 (most do) and you have some Chinese fonts installed then
create a file called 世界你好.mcm
世with the following content: 界
MCM 世界你好 define helloWorld() File path> /helloworld.txt content: Hello World! define 世界你好() File content> 世界你好! path> /世界你好.txt
- 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 世界你好!