LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-24-2009, 02:34 AM   #1
PiNPOiNT
LQ Newbie
 
Registered: Apr 2009
Posts: 15

Rep: Reputation: 0
proper way to setup notepad++ to execute bash scripts?


What's the proper commandline to test bash scripts in notepad ++

Everything i've tried opens a cmd window briefly then dissapears. I can't get one to stay up and execute my code.

I'd like to simply be able to use the RUN menu from notepad++ to start my scripts while coding.

Thanks.
 
Old 04-24-2009, 07:35 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
According to this:
http://sourceforge.net/projects/notepad-plus/
notepad++ is a Windows program.

Please describe in more detail what you are doing. What OS, etc.
 
Old 04-24-2009, 08:03 PM   #3
PiNPOiNT
LQ Newbie
 
Registered: Apr 2009
Posts: 15

Original Poster
Rep: Reputation: 0
I'm using cygwin in windows, and you can run bash within it. I'm using notepad ++ to write the scripts. You can press a hotkey to execute the script, but im not sure what the syntax is to put into the hotkey.

It has to load cygwin and execute the script, and i've tried c:\cygwin\cygwin.bat script.sh and that will open a cmd window and then immediately close, i dont think its actually running anything.

Just wondering if anyone knows how to set it up properly, or if they use a different program for writing and testing bash scripts in a windows environment for use in cygwin
 
Old 04-25-2009, 10:26 AM   #4
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,780

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Quote:
i've tried c:\cygwin\cygwin.bat script.sh
That doesn't work, see cygwin.bat:
Code:
@echo off

C:
chdir C:\\bin  (yours probably says C:\\cygwin\\bin)

bash --login -i
It doesn't look at its arguments. C:\cygwin\bin\bash script.sh should work (if it complains about missing dll's try adding C:\cygwin\bin to the PATH). Also note that the window will close when the script ends, so you should have a call to sleep, or read at the end to prevent the window from closing before you can see it.
 
Old 04-25-2009, 11:27 AM   #5
PiNPOiNT
LQ Newbie
 
Registered: Apr 2009
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks for your help!

I got it working using this

Code:
C:\cygwin\bin\bash --login -i ./test.sh
or you can use

Code:
C:\cygwin\bin\rxvt.exe -fn "Lucida Console-14" -geometry 160x60 -sr -sl 1000 -e /bin/bash --login -i ./test.sh
This way makes things a bit nicer to read.

Creating batch files or shorcuts work this way as well if you want to simply have a icon to click to run your script

Thanks again!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
script in crontab do not execute or take proper environment of user mayank_a Linux - Server 1 07-02-2007 05:03 AM
how to execute bash scripts from C????? :( cho Programming 2 06-19-2005 07:15 PM
execute bash scripts vapor Programming 9 07-14-2003 02:54 PM
cant execute any scripts Phonics3k Linux - Newbie 2 06-19-2002 08:00 AM
How to execute Linux scripts LenkaNguyen Linux - General 2 12-07-2001 03:12 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration