Hello,
I wrote this
wri(e) := with_stdout(sconcat(e,".",load_pathname,"out"),cgrind(e));
and I see that load_pathname is unset when using maxima -b foo.mac
(resolves to "nil").
As a workaround it's ok with
maxima --init-mac=foo.mac --batch-string "quit();"
but maxima manual documents load_pathname is set by any of the loading commands.
Sincerely yours,
e.m.