In 'pwebmac.tex' I reduced the code to
\chardef\pdfshellescape \directlua{tex.sprint((status.shell_escape or os.execute()) .. " ")} for LuaTeX and it works nicely further below in \ifpdflua \makebookmarks % added in Version 4.5 \ifnum\pdfshellescape=1 {\let\\=\BS % count the @<named sections@> \global\countD=\input{|grep -c -e '\\:\\X' \jobname.tex}} \fi\fi Cheers, Andreas