delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/07/04/01:39:05

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=2.8 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,T_RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <34111361.post@talk.nabble.com>
Date: Tue, 3 Jul 2012 22:38:36 -0700 (PDT)
From: Gundament <Gundament AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Why won't my .sh file work with cygwin?
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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,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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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019