1 # echoToFile.coffee - Write in a given file all the parameters passed on the CLI
3 system = require 'system'
5 if system.args.length < 3
6 console.log "Usage: echoToFile.coffee DESTINATION_FILE <arguments to echo...>"
12 while i < system.args.length
13 content += system.args[i] + (if i == system.args.length - 1 then "" else " ")
16 fs.write system.args[1], content, "w"