我在尝试从Shell脚本执行prolog程序时遇到Syntax error: "(" unexpected
。
这是我的shell脚本:
#!/bin/sh
set -xv
yap -L test1(pos,1,2))\. >> rules.pl
这是错误消息:
yap -L test1(pos,1,2))\. >> rules.pl
./tp.sh: 3: ./tp.sh: Syntax error: "(" unexpected
test1(pos,1,2).
在我直接从yap运行时运行。
已经尝试过How to run prolog queries from within the prolog file in swi-prolog?。