From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21300 invoked by alias); 31 Oct 2003 09:17:09 -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 21280 invoked from network); 31 Oct 2003 09:17:03 -0000 Received: from unknown (HELO host.linuxsv3.net) (69.56.174.13) by sources.redhat.com with SMTP; 31 Oct 2003 09:17:03 -0000 Received: from c-67-160-219-187.client.comcast.net ([67.160.219.187] helo=dessent.net) by host.linuxsv3.net with asmtp (Exim 4.24) id 1AFVOr-0004oK-7u for cygwin@cygwin.com; Fri, 31 Oct 2003 01:16:57 -0800 Message-ID: <3FA2288C.1B256348@dessent.net> Date: Fri, 31 Oct 2003 10:52:00 -0000 From: Brian Dessent Organization: My own little world... X-Accept-Language: en,en-US MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: launch shell script from windows explorer References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.linuxsv3.net X-AntiAbuse: Original Domain - cygwin.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dessent.net X-SW-Source: 2003-10/txt/msg01826.txt.bz2 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 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/