The short story is something like
jconsole.exe -js scriptname.ijs arg0 arg1 arg2
And in your script, ARGV_z_ will be defined as <;._2 'jconsole.exe
scriptname.ijs arg0 arg1 arg2 ' . That is, you can say things like 1{::2}.ARGV
to get 'arg1' .
If you're looking for other "shell script syntax", then 1!:45'' is the current
working directory (which works best of jconsole.exe is on your %PATH% or if you
call it with a fully qualified path). J's provision for stdin isn't as
convenient as some other languages', but look if you need it, look into 1!:1]1
or even 0:0 if you can convince the source of stdin to terminate it with a lone
) . But I find J more useful for (file based) applications than shell
scripting.
By the way, there's a writeup on the Wiki describing how to associate ijs files
with J, so you could even just double click them (or skip the jconsole.exe part
on the command line).
-Dan
Please excuse typos; composed on a handheld device.
-----Original Message-----
From: Justin Paston-Cooper <[email protected]>
Sender: [email protected]
Date: Sat, 23 Oct 2010 15:42:44
To: Programming forum<[email protected]>
Reply-To: Programming forum <[email protected]>
Subject: [Jprogramming] Calling J Scripts from the Command Line
Hello,
Can someone please direct me to a guide on calling J scripts on
Windows from the command line? I'd like to know about what facilities
there are for handling arguments and so on. I've looked through the
documentation, but I haven't found anything that's particularly
helpful.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm