From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: shell-command parameters Date: Tue, 06 Jan 2009 22:40:15 +0200 Message-ID: References: <67385669-7b4e-4bac-bc95-1f64689b6379@40g2000prx.googlegroups.com> <81eizhzxhq.fsf@myhost.sbcglobal.net> <818wppsa7o.fsf@myhost.sbcglobal.net> <72a44850-9df5-44f2-99d4-5aa90b48c15d@w1g2000prm.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1231274455 13103 80.91.229.12 (6 Jan 2009 20:40:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 Jan 2009 20:40:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jan 06 21:42:06 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LKIkN-0002hg-Pv for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Jan 2009 21:41:56 +0100 Original-Received: from localhost ([127.0.0.1]:33144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKIj8-00023T-Aj for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Jan 2009 15:40:38 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LKIii-00020I-GT for help-gnu-emacs@gnu.org; Tue, 06 Jan 2009 15:40:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LKIif-0001wd-JP for help-gnu-emacs@gnu.org; Tue, 06 Jan 2009 15:40:10 -0500 Original-Received: from [199.232.76.173] (port=50550 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LKIif-0001wB-GU for help-gnu-emacs@gnu.org; Tue, 06 Jan 2009 15:40:09 -0500 Original-Received: from mtaout2.012.net.il ([84.95.2.4]:59353) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LKIie-0004gB-Ri for help-gnu-emacs@gnu.org; Tue, 06 Jan 2009 15:40:09 -0500 Original-Received: from conversion-daemon.i_mtaout2.012.net.il by i_mtaout2.012.net.il (HyperSendmail v2004.12) id <0KD200700HCUI100@i_mtaout2.012.net.il> for help-gnu-emacs@gnu.org; Tue, 06 Jan 2009 22:40:10 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.127.238.249]) by i_mtaout2.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0KD200GY9HEWHIN0@i_mtaout2.012.net.il> for help-gnu-emacs@gnu.org; Tue, 06 Jan 2009 22:40:09 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 9.1 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:61132 Archived-At: > From: rustom > Date: Tue, 6 Jan 2009 07:02:14 -0800 (PST) >=20 > On Jan 6, 7:29=A0pm, Kevin Rodgers wrot= e: > > rustom wrote: > > > But I still wonder what shell is running in windows emacs? > > > > ,----[ C-h v shell-file-name RET ] > > | shell-file-name is a variable defined in `src/callproc.c'. > > | Its value is "/bin/bash" >=20 >=20 > Thanks. Thats the variable I was looking for. > It turns out to be /path/to/emacs/bin/cmdproxy.exe > Changing it to c:/cygwin/bin/bash.exe makes it work as expected (by= a > unix user) >=20 > I wonder does emacs go out of its way to make life difficult for a > windows user? MS does a good job of this without help from emacs := -) > I mean 'cmd' has one expected behavior; shell has another. Why make > the 'shell' variable point to a cmd imitation? cmdproxy is not an imitation of CMD, it's a _proxy_ which eventually invokes the real CMD.EXE. Thus its name. As to the reasons why this is needed, here's the relevant commentary =66rom cmdproxy.c: Accepts subset of Unix sh(1) command-line options, for compatibili= ty with elisp code written for Unix. When possible, executes externa= l programs directly (a common use of /bin/sh by Emacs), otherwise invokes the user-specified command processor to handle built-in sh= ell commands, batch files and interactive mode. The main function is simply to process the "-c string" option in t= he way /bin/sh does, since the standard Windows command shells use th= e convention that everything after "/c" (the Windows equivalent of "-c") is the input string.