Need help converting the following Perl script to Bash shell script :
#!/usr/bin/perl -w
$SIG{INT} = 'IGNORE';
$SIG{TSTP} = 'IGNORE';
$SIG{TERM} = 'IGNORE';
$SIG{QUIT} = 'IGNORE';
print " Challenge1 : ";chomp($a=<STDIN>);
print " Challenge2 : ";chomp($b=<STDIN>);
while ($a ne "123456" || $b ne "456789"){
print " Challenge1 : ";chomp($a=<STDIN>);
print " Challenge2 : ";chomp($b=<STDIN>);
}
I understand it's a simple while loop checks the STDIN values "Challenge1, and Challenege2" compared to "123456 and 456789" if correct it exit the loop or else ask for Challenges again. I'm pretty sure it's a nooby question and I'd better to learn Shell scripting but I really need it as soon as possible.
Also I've another question; How to store the reference values(i.e; 123456 and 456789) of Challenge1 and Challenge2 in an encrypted form say MD5 and even more save those values in another text file rather than showing them in the same shell script (i.e; compare STDIN to reference values in /home/user/challenges.txt).
Thanks in advance ;
# sorry if this post does not appear in a proper section -- newbie member.


Sign In
Create Account

Back to top









