How to run a .clp file (jess) in windows cmd / .bat file? My current file looks like that:
(deftemplate Tree (slot current_node)(slot node_childrens))
(assert (Tree (current_node A)(node_childrens B,C,D)))
(assert (Tree (current_node B)(node_childrens E)))
(assert (Tree (current_node C)(node_childrens F,G)))
(defrule display_data
(Tree (current_node ?cn))
=>
(printout t ?cn " ")
)
(run)
After running that the output in console looks like this:
C B A
How I can run that file from windows cmd and see the output there? For example if I have a python file called "myfile.py" I can run that with following command:
python myfile.py
How I can run a jess file in windows cmd / from a .bat file?
To run
python myfile.pyinside of a batch file you could do:myscript.bat:
However if you have the
clipscommand line tool installed you can do this:script.bat
And then call it using
clips -f2 script.batwhich can also be called from a batch file.