HOWTO:Run Lily from command line

From LilyWiki

Jump to: navigation, search

Someone asked for a way to run a Lily patch from a cron job with the ability to pass parameters in and get output from stdout. Here's one solution: a Xulrunner Lily application with an http interface (using the httpd external) that can be called from a shell script that starts the application and makes a curl call to the patch. The app shuts itself down when once its output is complete. I put together a sample application that demonstrates this - it just echoes back whatever input is passed to the script. You can download it here: http://blog.lilyapp.org/downloads/lily_cmdline.zip

Image:Echo.jpg



#!/bin/sh

echo.app/Contents/MacOS/xulrunner &

sleep 10

curl --retry 10 http://localhost:6669/$1


$ sh cmdline.sh hello
hello
Personal tools