Re: Why won't my .sh file work with cygwin?

2012-07-04 Thread Thorsten Kampe
* Gundament (Tue, 3 Jul 2012 22:38:36 -0700 (PDT))
 
 I am new to Cygwin but I understand it does it's best to simulate a
 linux terminal.

No. Cygwin is: a collection of tools which provide a Linux look and 
feel environment for Windows. http://cygwin.com/
 
 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)

You are confusing a terminal (like Mintty) with a shell (like bash).

Thorsten


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



Re: Why won't my .sh file work with cygwin?

2012-07-04 Thread Eric Blake
On 07/03/2012 11:38 PM, Gundament wrote:

 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.

 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}

You are generating 308915776 combinations, occupying 2,162,410,431
bytes, and trying to store it all in memory at once.  You ran out of
memory.  There's nothing we can do to help you if you are bent on
crashing bash by exhausting memory.

-- 
Eric Blake   ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature


Re: Why won't my .sh file work with cygwin?

2012-07-04 Thread Andy Koppe
On 4 July 2012 11:04, Thorsten Kampe wrote:
 * Gundament (Tue, 3 Jul 2012 22:38:36 -0700 (PDT))

 I am new to Cygwin but I understand it does it's best to simulate a
 linux terminal.

 No. Cygwin is: a collection of tools which provide a Linux look and
 feel environment for Windows. http://cygwin.com/

That doesn't exactly contradict what the OP was saying. Needlessly unwelcoming.

 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)

 You are confusing a terminal (like Mintty) with a shell (like bash).

Maybe so, but invoking a shell script in that way does work, if it has
executable permission. That's because the exec() function that mintty
uses to invoke the program passed on its command line automatically
runs /bin/sh if the program isn't a binary. Same for other terminals.

Andy

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



Re: Why won't my .sh file work with cygwin?

2012-07-04 Thread David Sastre Medina
Completely unrelated to your script problem but you should definitely
take a look at pwgen (there's a cygwin package).

-- 
Primary key fingerprint: AD8F BDC0 5A2C FD5F A179  60E7 F79B AB04 5299 EC56


signature.asc
Description: Digital signature


Why won't my .sh file work with cygwin?

2012-07-03 Thread Gundament

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