delorie.com/archives/browse.cgi | search |
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 |
To: | cygwin AT cygwin DOT com |
X-Injected-Via-Gmane: | http://gmane.org/ |
Path: | not-for-mail |
From: | Andrew DeFaria <ADeFaria AT Salira DOT com> |
Newsgroups: | gmane.os.cygwin |
Subject: | Re: Bash shell extension ? |
Date: | Fri, 12 Apr 2002 14:39:07 -0700 |
Lines: | 52 |
Message-ID: | <3CB753FB.5020907@Salira.com> |
References: | <019201c1e1cf$7026dec0$52b4fc3e AT nori> <3CB70C91 DOT 204 AT DeFaria DOT com> <3CB71B61 DOT 6020707 AT dramgo DOT co DOT uk> <3CB7339E DOT 6080409 AT Salira DOT com> <3CB7402D DOT 2010404 AT dramgo DOT co DOT uk> <3CB745A9 DOT 5090809 AT Salira DOT com> |
Reply-To: | cygwin AT cygwin DOT com |
NNTP-Posting-Host: | 206.184.204.2 |
Mime-Version: | 1.0 |
X-Trace: | main.gmane.org 1018647541 13338 206.184.204.2 (12 Apr 2002 21:39:01 GMT) |
X-Complaints-To: | usenet AT main DOT gmane DOT org |
NNTP-Posting-Date: | Fri, 12 Apr 2002 21:39:01 +0000 (UTC) |
User-Agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.4.1) Gecko/20020314 Netscape6/6.2.2 |
X-Accept-Language: | en-us |
Andrew DeFaria wrote: > Donald MacVicar wrote: > >>>> surely you could just have @="rxvt -ls -e bash -c \"cd '%1'; exec >>>> bash --login\"" and then all the startup scripts would be run >>>> properly? >>> >>> Nope! Because --login runs /etc/profile and /etc/profile cd's to $HOME! >> >> Realised that about 10 secs after I sent the mail. > > I know how that goes! :-) > >> how about put the --login on the first bash - i.e. txvt -ls -e bash >> --login -c ...... Just tried that and it seems to wok. > > Perhaps. Actually I'm a big advocate of putting options in > ~/.Xdefaults to make the command line for things like rxvt a lot > shorter. I already have loginShell set to true there so the -ls is > irrelevent in my situation. > > Actually does anybody know how to make this run minimized by default? > I say that because there is that annoying, flashing window that > Windows apparenlty runs cmd in to execute the contents of the command > key here. My workaround for this, WRT shortcuts say on the desktop, is > to preceed this already long command with "cmd /c start /b..." but > then set the shortcut to run minimized. So instead of a large flashing > cmd window there's a momentary blip in the taskbar that is quickly > replaced with the rxvt entry. BTW the /c is equivalent to -c and > start's /b option says don't open a cmd window for this command. Actual experiementation shows me that both are needed! you need --login on the first bash so that /etc/profile gets executed. The -c then executes putting you in the right directory. The "; exec bash" is needed so that the -c command doesn't complete. If it did then bash would exit and you'd just have a flicker on the screen. In this new exec'ed bash there has been no indication to bash that you want any start up scripts to be processed. Putting --login on the second exec'ed bash gets you back to the same problem since /etc/profile does a cd "$HOME". Yet without any startup scripts running your enviornment is less than ideal. So you need -rcfile ~/.bash_login on the second, exec'ed bash so run your rcfile. To recap, for bare bones Windows window execution you need: bash --login -c "cd '%1'; exec bash -rcfile ~/.bash_login" For an rxvt window do: rxvt -e bash --login -c "cd '%1'; exec bash -rcfile ~/.bash_login" -- 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/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |