User input in %post kickstart

Is there a way to use bash “read” command in the %post installation? how to redirect the standard output to a terminal for user interaction?

Sure it’s possible.

%post
iotty=`tty`
exec > $iotty 2> $iotty

read -p "Enter your first name: " firstname
read -p "Enter your last name: " lastname
echo "Your name is: $firstname $lastname"

If the installation has a GUI running, you can use zenity in some form to avoid TTY switching.

Thank you, the installation is graphical. I used the above suggestion but the installation hangs and regarding to the zenity, how to use it during the %post
kickstart?

Something like:

%post
firstname=$(zenity --entry --text=“Enter your first name”)
lastname=$(zenity --entry --text=“Enter your last name”)
zenity --info --text=“Your name is: $firstname $lastname”

Thank you all. The tty also worked - all I had to do was to switch the display (Alt-Ctl-f1)