You cannot directly evaluate a SKILL function in the shell. Put the SKILL function name and its call into a file you pass to Virtuoso. You have to start Virtuoso and use the -replay argument. The function should also execute exit() to close the Virtuoso session:
echo "load( \"mySkillFunction.il\" ) mySkillFunction( $1 $2 ) exit()" > runMySkillFunc.il
virtuoso -nograph -replay runMySkillFunc.il
let me explain my question in detail:
I have a script "ab.csh"
icfb -nograph -replay ab.il
I have a skill script "ab.il"
I run in c_shell commands as below:
ab.csh analib diglib
It seems that this does not work,could you help me about this ,thanks.
$1 and $2 do not have values inside icfb. You have to create a new SKILL function with the values from $1 and $2 in the function call. That is why I included the echo statement above, the $1 and $2 values are put into the function runMySkillFunc.il and when it is loaded the function is executed with the values.
In addition, the replay file does not automatically load the file ab.il. That is why I had the load statement in my echo output above.
For your problem you need to create a file, we will call it runab.il. It should contain the following statements which could all be on the same line:
load("ab.il")ab( "analib" "diglib" )exit()
The other thing you could do is to set an environment variable containing the arguments inside your script:
#!/bin/shexport ARGS="$0 $*"icfb -nograph -restore ab.il
And then in the SKILL code (ab.il)
args=listToVector(parseString(getShellEnvVar("ARGS")||""))printf("The script was called %s\n" args)printf("The arguments were '%s' and '%s'\n" args args)exit()
If I then do "runScript hello world" I get:
The script was called runScriptThe arguments were 'hello' and 'world'