From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10525 invoked by alias); 31 Oct 2003 20:43:22 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 10511 invoked from network); 31 Oct 2003 20:43:19 -0000 Received: from unknown (HELO main.gmane.org) (80.91.224.249) by sources.redhat.com with SMTP; 31 Oct 2003 20:43:19 -0000 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AFg74-0004CW-00 for ; Fri, 31 Oct 2003 21:43:18 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: cygwin@cygwin.com Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AFg73-0004CO-00 for ; Fri, 31 Oct 2003 21:43:17 +0100 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AFg73-00069g-00 for ; Fri, 31 Oct 2003 21:43:17 +0100 From: "Hans Horn" Subject: Re: launch shell script from windows explorer Date: Fri, 31 Oct 2003 21:38:00 -0000 Message-ID: References: <3FA2288C.1B256348@dessent.net> X-Complaints-To: usenet@sea.gmane.org X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-SW-Source: 2003-10/txt/msg01868.txt.bz2 Brian, thx a lot for helping out here! I ended up producing the following .reg script that adds the context menu item "Run script" to files with extersion .sh. When clicked, it opens an rxvt console in the path of the .sh file and executes the .sh file. cheerio, Hans "Brian Dessent" wrote in message news:3FA2288C.1B256348@dessent.net... > Hans Horn wrote: > > > > Dear cygwinners, > > As long as we're not cyglosers... > > > after searching the archives w/o luck, I'd ask this mailing list. > > > > I'd like to know how I would go about the following: > > > > I'd like to launch a shell script from within windows explorer (either > > double-click or via context menu) in a way that: > > - a console (or rxvt window, preferrably) is opened in the folder where the > > script resides > > - the script is executed > > - the cnsole stay open after the script has finished > > > > So far I have managed only the first bit (console/rxvt) + script execution, > > but the console closes immediately when the script is done. > > I don't know if there's a better way to do this, but you might be able > to achieve the desired effect by adding an explict call to the shell > after the script... for example, the windows command line might resemble > > \cygwin\bin\bash -lc ". somescript.sh && bash -i" > > This results in two copies of bash being used, but I don't see a way > around that. If you want the prompt to appear even if the script fails > then change '&&' to ';'. If you don't want it to start in your home > directory (and you don't care about variables like the path being > initialized for you, and the rest of /etc/profile) then omit the -l > parameter which tells it to be a login shell. If you want it to not > start in your home directory but still want the path set correctly, then > you'll have to come up with a workaround. One way might be something > like: > > \cygwin\bin\bash -c ". ~/set-path.sh && . ~/somescript.sh && bash -i" > > Where set-path.sh is like /etc/profile except without the final "cd > $HOME", and somescript.sh is the thing you want to actually run. > > I think others on this list have suggested cleaner ways around this > problem of needing the path setup but not wanting to start in $HOME, so > you might try searching the archives. > > Brian > begin 666 exec-script.reg M__Y7`&D`;@!D`&\`=P!S`" `4@!E`&<`:0!S`'0`<@!Y`" `10!D`&D`= !O M`'(`( !6`&4`<@!S`&D`;P!N`" `-0`N`# `, `-``H`#0`*`%L`2 !+`$4` M60!?`$,`3 !!`%,`4P!%`%,`7P!2`$\`3P!4`%P` !V`'0`+@!E`'@`90`@`"T`8@!A M`&,`:P!S`' `80!C`&4`:P!E`'D`( !>`&@`( `M`&(`9P`@`&(`; !A`&,` M:P`@`"T`9@!G`" `=P!H`&D`= !E`" `+0!C`'(`( !Y`&4`; !L`&\`=P`@ M`"T` `W`#0`*P`P`"L` M, `@`"T`