PREV INDEX NEXT

Author: Unknown
Subject: cd -p response
Date: Sunday, 06 Dec 2020, 11:03:56

I don't quite understand the strategy that you're describing, but I think the method for implementing built-ins is to not use a child shell (because the child can't manipulate the parent for cd [DIRECTORY] and export N=V). That is, check before calling handle_andor if the command is a simple and if argv[0] is equal to a builtin command. If a builtin appears at some level lower than an andor, it can be handled in a child shell because it doesn't have to affect the parent shell (see reference implementation).
PREV INDEX NEXT