pgr -f'%#.c' -qFN -e'uniq()' < ?input-file > ?output-file
Note 1: this works as expected on my Mac
2) Now suppose I want to wrap it in a CLIPS function, e.g.:
(deffunction CL-pgr (?input-file ?output-file)
(bind ?cmd
(str-cat
pgr
"-f'%#.c' -qFN -e'uniq()'"
" < " ?input-file
" > " ?output-file
)
)
(system ?cmd)
)
Note 2: this works as expected on my Mac
Note 2bis: there are many alternative ways to get it to work.
3) Now suppose I want to include this CLIPS function in e.g. a loop-for-count loop in which successive ?input and ?output files are defined before each call to CL-pgr.
It doesn't work.
More specifically, the -e'uniq()' part is not taken into account .
Does anyone understand what's happening here?
PS: I tried with CLIPS 6.3 and 6.4 (r952) on MacOS 15.3.2.
I use the generic settings of CLIPS.
#include <stdlib.h>
int main()
{
system("date");
system("date -v1m -v+1y");
system("date -v1d -v+1m -v-1d -v-fri");
}
CLIPSUnix % gcc -o test test.c
CLIPSUnix % ./test
Tue Mar 18 21:46:36 CDT 2025
Sun Jan 18 21:46:36 CST 2026
Fri Mar 28 21:46:36 CDT 2025
CLIPSUnix %