Hi all!
I have this while loop in my script:
while (($type ne "Windows") || ($type ne "Linux")) {
print "Enter TYPE of server to build. Linux or Windoze [linux, windows]:
\n";
$type = <STDIN>;
chomp $type;
$type =~ tr/a-z/A-Z/;
if (($type eq "LINUX") || ($type eq "L")) {
$type = "Linux"; }
if (($type eq "WINDOWS") || ($type eq "W")) {
$type = "Windows"; }
}
I had hoped that it would prompt the user until they made a valid
choice, either L, linux, w or windows. Instead it loops over and over
even if valid input is received. What am I doing wrong here?
I have another while loop that works just fine:
while ($LUN !~ /\d+.\d+.\d+.\d+/) {
print "Enter LUN to build boot partition on. LUN Format is 3.0.0.33
[X.X.X.X]: \n";
$LUN = <STDIN>;
chomp $LUN; }
Thanx!