reading user input in %pre script no longer working

Steve Robson srobson at cadence.com
Thu Sep 6 08:55:35 UTC 2007


Ben Grommes <ben.grommes at visionshareinc.com> spake thusly:

> My kickstart script reads user input in the %pre scriptlet using the read
> command.  This worked fine in CentOS 4.4, but in CentOS 4.5 it no longer works.
>  It appears that the read command is not taking input from the console.
> 
> I'm doing a headless mode install (text option in ks.cfg).
> 
> Here is my %pre script:
> 
> %pre
> install="no"
> while [ "$install" != "yes" ]; do 
>     (
>     echo -n "Proceed with install? "
>     )>/dev/tty1
>     read install
> done
> 
> The output of the echo shows up on the screen, but the read command doesn't
> accept any input from the keyboard.
> 
> Any suggestions for how to debug this would be appreciated.

Try explicitly redirecting stdin as well:

%pre
install="no"
while [ "$install" != "yes" ]; do
     ( echo -n "Proceed with install? " ) >/dev/tty1 </dev/tty1
     read install
done

-- 
   Regards,
   Steve

IT Support - UNIX/Linux                        Cadence Design Systems
                                                Bagshot Road
                                                Bracknell BERKSHIRE
                                                RG12 0PH   UK




More information about the Kickstart-list mailing list