Unix/Linux Go Back    


Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here!

run cygwin bash script from notepad++

Windows & DOS: Issues & Discussions


Closed    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 10-19-2012   -   Original Discussion by millsy5
millsy5's Unix or Linux Image
millsy5 millsy5 is offline
Registered User
 
Join Date: Oct 2011
Last Activity: 13 November 2013, 4:22 AM EST
Posts: 44
Thanks: 19
Thanked 0 Times in 0 Posts
run cygwin bash script from notepad++

I'm using Notepad++ to edit my BASH scripts and using CYGWIN to run them from Windows7.

In Notepad++ there is a 'Run' capability. How do I get this to run my scripts directly without having to enter the script name from the Cygwin command line?
Sponsored Links
    #2  
Old Unix and Linux 10-19-2012   -   Original Discussion by millsy5
jim mcnamara's Unix or Linux Image
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 13 December 2017, 7:46 AM EST
Location: NM
Posts: 11,249
Thanks: 577
Thanked 1,121 Times in 1,033 Posts
Okay I assume that run there works like the run Windows provides:


Code:
 c:\cygwin\bin\bash -- login "c:\myscript.sh"

Note:
bash will not like Windows carriage returns in your script. Be sure to have notepad++ save the file as a UNIX file.
Sponsored Links
    #3  
Old Unix and Linux 10-22-2012   -   Original Discussion by millsy5
millsy5's Unix or Linux Image
millsy5 millsy5 is offline
Registered User
 
Join Date: Oct 2011
Last Activity: 13 November 2013, 4:22 AM EST
Posts: 44
Thanks: 19
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by jim mcnamara View Post
Okay I assume that run there works like the run Windows provides:


Code:
 c:\cygwin\bin\bash -- login "c:\myscript.sh"

Note:
bash will not like Windows carriage returns in your script. Be sure to have notepad++ save the file as a UNIX file.
where exactly do i enter this? when i select 'run' in notepad++ i can set the directory but how do i select the file? the login part does not open it.
    #4  
Old Unix and Linux 10-24-2012   -   Original Discussion by millsy5
jim mcnamara's Unix or Linux Image
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 13 December 2017, 7:46 AM EST
Location: NM
Posts: 11,249
Thanks: 577
Thanked 1,121 Times in 1,033 Posts
Try to get your script working from the Start->run menu first. Use Windows syntax

bash has to have a complete path to the file /somefolder/script.sh

Use a forward slash, I put a backward slash - my bad.

The windows drives are /cygdrive/c /cygdrive/d ... /cygdrive/z Assuming you have a Z: drive, but you get the idea.

So if your script is in
Code:
 c:\someplace\anotherplace\myscript.sh

then full path is

Code:
/cygdrive/c/someplace/another/myscript.sh


Last edited by jim mcnamara; 10-24-2012 at 12:05 AM..
Sponsored Links
Closed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
bash command in makefile (cygwin) LMHmedchem Shell Programming and Scripting 7 03-21-2011 08:23 PM
BASH: Script jams Cygwin to 100% CPU - SilversleevesX Shell Programming and Scripting 6 09-22-2010 06:19 PM
Output of the script in notepad mastercar UNIX for Dummies Questions & Answers 7 05-12-2010 06:22 AM
Cygwin bash script and read command Teroc UNIX for Dummies Questions & Answers 2 04-16-2010 05:15 AM
How to use cygwin to run bash script Jenny.palmy UNIX for Dummies Questions & Answers 6 04-28-2008 01:00 PM



All times are GMT -4. The time now is 02:55 PM.