[chuck-users] pass arguments without the pesky colons

N. Cameron Britt nbritt at princeton.edu
Sun Aug 10 12:20:18 EDT 2008


Don't know if this is useful to anyone, but here's a little Perl script that
allows you to pass arguments to Chuck separated by spaces rather than
colons. Run this and let Perl run Chuck for you with properly formatted
arguments. Should be in the same directory as the Chuck file you're trying
to run.

#!/usr/bin/perl
my $args = join(":", @ARGV);
$cmd = "chuck YOUR_CHUCK_FILE.ck" . ":$args";
#print "$cmd\n";
exec($cmd);

Run with a command something like this:
./arg.pl arg1 arg2 arg3 etc

I could imagine something like this being expanded into some sort of on the
fly programming front end, to pass arrays of pitches for example.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20080810/da2c69e7/attachment.htm>


More information about the chuck-users mailing list