I am new to Cygwin but I understand it does it's best to simulate a linux
terminal.
I want to make a little program and I have written out the entire code and
saved it as a .sh file.
I have paired my Windows computer to open .sh files with Cygwin's mintty.exe
(terminal)
However for some reason, when I run the .sh file it gets to the 6th line and
then just closes abruptly when it is not supposed to.
Once I enter the value for the read x command on line 6, it just closes
the terminal.
Here is my code:
echo Thank you for using Gundament's Password Possibility Generator
echo Press enter to Continue...
read -p
echo Enter the Number of Characters you want the password possibilities to
be. (Limit 7 Characters)
echo Example: 1 - 7 or Enter the letter 'A' in order to display all
possibilities up to 7
read x
echo Please wait while your request is processed... (This can take several
minutes)
one=a b c d e f g h i j k l m n o p q r s t u v w x y z
two={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}
three={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}
four={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}
five={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}
six={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}
seven={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}
case $x in
1)
echo $one $HOME/OneCharPasswords.txt
echo DONE!
echo You can find your Password file(s) here: $HOME
;;
2)
eval echo $two $HOME/TwoCharPasswords.txt
echo DONE!
echo You can find your Password file(s) here: $HOME
;;
3)
eval echo $three $HOME/ThreeCharPasswords.txt
echo DONE!
echo You can find your Password file(s) here: $HOME
;;
4)
eval echo $four $HOME/FourCharPasswords.txt
echo DONE!
echo You can find your Password file(s) here: $HOME
;;
5)
eval echo $five $HOME/FiveCharPasswords.txt
echo DONE!
echo You can find your Password file(s) here: $HOME
;;
6)
eval echo $six $HOME/SixCharPasswords.txt
echo DONE!
echo You can find your Password file(s) here: $HOME
;;
7)
eval echo $seven $HOME/SevenCharPasswords.txt
echo DONE!
echo You can find your Password file(s) here: $HOME
;;
A)
eval echo $one $HOME/OneCharPasswords.txt
eval echo $two $HOME/TwoCharPasswords.txt
eval echo $three $HOME/ThreeCharPasswords.txt
eval echo $four $HOME/FourCharPasswords.txt
eval echo $five $HOME/FiveCharPasswords.txt
eval echo $six $HOME/SixCharPasswords.txt
eval echo $seven $HOME/SevenCharPasswords.txt
echo DONE!
echo You can find your Password file(s) here: $HOME
;;
esac
echo Thank you for using Gundament's Password Possibility Generator!!!
echo Press Enter to close...
read -p
exit
--
View this message in context:
http://old.nabble.com/Why-won%27t-my-.sh-file-work-with-cygwin--tp34111361p34111361.html
Sent from the Cygwin list mailing list archive at Nabble.com.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple