Re: case tag scripting issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2005-01-10 at 10:45, Chadley Wilson wrote:
> Greetings
> 
> Could some one please help here:
> Why does the second prompt  in this part of the script skip?
> 
> this is what I get in the shell:
> 
> Installing the Kernel, Do you want continue? (Y/N) y       
> Installing the Kernel Source, Do you want continue? (Y/N) Please enter Y or N
> 
> 
> This is the section of the script.
> 
> 
> 
> read -n 1 -p "Installing the Kernel, Do you want continue? (Y/N) " YesNo
> 
> 
>         case $YesNo in
> 
>                 y|Y)
>                         rpm -i kernel-2.6*.i686.rpm
>                         ;;
> 
>                 n|N)
> 
>                         exit 0
>                         ;;
> 
>                 *)
>                         echo -e "Please enter Y or N"
>                         ;;
>         esac
> 
> 
> 
> 
> read -n 1 -p "Installing the Kernel Source, Do you want continue? (Y/N) " 
> YesNo
> 
> 
>         case $YesNo in
> 
>                 y|Y)
>                         rpm -i kernel-2.6*.src.rpm
>                         ;;
> 
>                 n|N)
> 
>                         exit 0
>                         ;;
> 
>                 *)
>                         echo -e "Please enter Y or N"
>                         ;;
>         esac
> 

Simple answer perhaps...

Are you hitting return after entering Y?

Note your read -n 1 is, I believe only going to read the one letter and
the "return" is buffered for the next read statement???

Of course, I am assuming that it was just the email that wrapped your
second "YesNo" onto a second line.... ;-)

--Rob


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux