1

I have a clipscode which I want to insert in my database I wrote a Java prog for that and it is running fine in eclipse IDE if my clips code contains "$?" it preserved as it is in eclipse IDE. see the output of eclipse IDE

(defrule through_the_use_of_1364;through the use of

(Head-Level-Mother-Daughters ?h1 ?l1 ?m1 $? ?m $?)

=>

(printout debug_rule "(through_the_use_of_1364)" crlf))

The problem occurs When I made a jar of the program and run on my terminal "$?" is converted as 0.
see the output of terminal is given below.

(defrule through_the_use_of_1364;through the use of

(Head-Level-Mother-Daughters ?h1 ?l1 ?m1 0 ?m 0)

=>

(printout debug_rule "(through_the_use_of_1364)" crlf))

Please help me....

1 Answer 1

1

The shell is interpreting $? as the exit status of the previous command.

To prevent shell interpretation:

Use quotes around $?:

(Head-Level-Mother-Daughters ?h1 ?l1 ?m1 "$?" ?m "$?")

Or

(Head-Level-Mother-Daughters ?h1 ?l1 ?m1 '$?' ?m '$?')

Or escape $ with \:

(Head-Level-Mother-Daughters ?h1 ?l1 ?m1 \$? ?m \$?)
1
  • The last option worked for me. (Head-Level-Mother-Daughters ?h1 ?l1 ?m1 \$? ?m \$?)
    – JalT
    Jan 27, 2016 at 8:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .