Du hast da nen ziemlich relevanten Teil es Scripts gelöscht:
mkfifo $PIPE legt eine sog. "named pipe" (fifo) an, die wird dann genutzt um yad mit Kommandos zu versorgen. Stell Dir das wie ne Verbindungsleitung zwischen zwei Programmen vor. "|" kennst Du wahrscheinlich schon, damit verbindest Du die Ausgabe des Befehls vor der Pipe mit der Eingabe des Befehls nach der Pipe. Salopp gesagt, mit mkfifo kannst Du die Verbindungstücke anlegen, die dann als "Datei" im Filesystem auftauchen und an die Du dann die Programme anschließen kannst.
https://www.systutorials.com/docs/linux/man/7-fifo/
http://pubs.opengroup.org/onlinepubs/96 ... g_18_07_07
und man bash sagt
exec [-cl] [-a name] [command [arguments]]
If command is specified, it replaces the shell. No new process is created. The arguments become the arguments to command. If the -l option is supplied, the shell places a dash at the beginning of the zeroth argument passed to command. This is what login(1) does. The -c option causes command to be executed with an empty environment. If -a is supplied, the shell passes name as the zeroth argument to the executed command. If command cannot be executed for some reason, a non-interactive shell exits, unless the execfail shell option is enabled. In that case, it returns failure. An interactive shell returns failure if the file cannot be executed. If command is not specified, any redirections take effect in the current shell, and the return status is 0. If there is a redirection error, the return status is 1.