библиотека программных диалогов с интерактивными программами (programmed dialogue library with interactive programs)
IF YOU WANT TO ALLOCATE YOUR OWN PTY
extern int exp_autoallocpty;
extern int exp_pty[2];
The spawn functions use a pty to communicate with the process.
By default, a pty is automatically allocated each time a process
is spawned. If you want to allocate ptys yourself, before
calling one of the spawn functions, set exp_autoallocpty
to 0,
exp_pty[0]
to the master pty file descriptor and exp_pty[1]
to
the slave pty file descriptor. The expect library will not do
any pty initializations (e.g., exp_stty_init will not be used).
The slave pty file descriptor will be automatically closed when
the process is spawned. After the process is started, all
further communication takes place with the master pty file
descriptor.
exp_spawnl
and exp_spawnv
duplicate the shell's actions in
searching for an executable file in a list of directories. The
directory list is obtained from the environment.