delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/09/19/09:28:52

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-Id: <5.1.0.14.0.20020919101741.00a83648@jjmackay.ca>
X-Sender: john DOT doucette AT jjmackay DOT ca
Date: Thu, 19 Sep 2002 10:28:23 -0300
To: "Frantisek Dufka" <dufkaf AT seznam DOT cz>
From: John Daniel Doucette <john DOT doucette AT jjmackay DOT ca>
Subject: Re: Open bash at the current explorer directory?
Cc: cygwin AT cygwin DOT com
In-Reply-To: <000701c25fbc$ef4bd550$5365060a@franta>
Mime-Version: 1.0

At 2002-09-19 06:14, you wrote:
>John,
>
>it doesn't work for me. In the second invocation of bash via "exec
>bash --noprofile --norc -i'' I don't see my environment variables and
>aliases defined in ~/.profile. Did you actually put something in ~/.profile
>and verified?
>
>Thanks,
>Frantisek

Sorry Frantisek et al,

Mea culpa. You are correct.  I was not using a .profile at all, thanks for 
pointing out the problem.  I have rearranged things and retested with a 
.profile.  I placed

alias profilels1='ls -s'
export PROFILE2=ProfileVariable2
export PATH=/cygdrive/c/Temp:$PATH

in my .profile in my home directory.  My OpenWith.reg file now contains:

===================== File:OpenWith.reg CUT HERE =======================
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\JddCustom_OpenWithCommandPrompt]
@="Open with Command Prompt"

[HKEY_CLASSES_ROOT\Directory\shell\JddCustom_OpenWithCommandPrompt\command]
@="c:\\WINNT\\system32\\cmd.exe %1"

[HKEY_CLASSES_ROOT\Directory\shell\JddCustom_OpenWithCygwinShell]
@="Open with Cygwin Shell (rxvt)"

[HKEY_CLASSES_ROOT\Directory\shell\JddCustom_OpenWithCygwinShell\command]
@="C:\\cygwin\\bin\\rxvt.exe -geometry 96x76+800+5 -fg gray -bg black -fn 
Fixedsys-8 -sl 2500 -sr -tn cygwin -e c:/cygwin/bin/bash --noprofile --norc 
-c \"export EXPLORERDIR=`cygpath -u '%1'`; exec bash --login -i\""

[HKEY_CLASSES_ROOT\Drive\shell\JddCustom_OpenWithCommandPrompt]
@="Open with Command Prompt"

[HKEY_CLASSES_ROOT\Drive\shell\JddCustom_OpenWithCommandPrompt\command]
@="c:\\WINNT\\system32\\cmd.exe /F:ON %1"

[HKEY_CLASSES_ROOT\Drive\shell\JddCustom_OpenWithCygwinShell]
@="Open with Cygwin Shell (rxvt)"

[HKEY_CLASSES_ROOT\Drive\shell\JddCustom_OpenWithCygwinShell\command]
@="C:\\cygwin\\bin\\rxvt.exe -geometry 96x76+800+5 -fg gray -bg black -fn 
Fixedsys-8 -sl 2500 -sr -tn cygwin -e c:/cygwin/bin/bash --noprofile --norc 
-c \"export EXPLORERDIR=`cygpath -u '%1'`; exec bash --login -i\""
====================== File: OpenWith.reg END CUT HERE=========================

I make the first invocation of bash avoid executing any scripts, then make 
the second exec invocation run the scripts instead.  I  don't get any 
double execution, the PATH variable doesn't get /cygdrive/c/Temp added to 
it twice, and I get the variables and aliases from both .profile and 
.bashrc.  Notice the new EXPLORERDIR variable. The many quotes are needed 
for directory names with spaces! I had to add these lines at the very 
bottom of the global /etc/profile file to get it to change to the directory 
desired though:

if [ "$EXPLORERDIR" ]; then
   cd "$EXPLORERDIR"
fi




===================================
John Daniel Doucette, Sr. Software Designer

J. J. MacKay Canada Limited
Halifax R & D Office
1046 Barrington Street, 1st Floor
Halifax, Nova Scotia
Canada
B3H 2R1

Phone: 902.423.7727  x222
Fax:     902.422.8108
Web:    www . jjmackay . ca
Email:  john . doucette @ jjmackay . ca
===================================


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019