From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Quote file name args to start-process-shell-command? Date: Thu, 12 Oct 2006 06:54:57 -0400 Message-ID: References: <452D54D8.7060705@student.lu.se> <452DDBC8.2060606@student.lu.se> <85y7rmou5t.fsf@lola.goethe.zz> <85d58xq3xd.fsf@lola.goethe.zz> Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1160650561 6310 80.91.229.2 (12 Oct 2006 10:56:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 12 Oct 2006 10:56:01 +0000 (UTC) Cc: schwab@suse.de, emacs-devel@gnu.org, lennart.borgman.073@student.lu.se Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 12 12:56:00 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GXyDf-0007oP-0y for ged-emacs-devel@m.gmane.org; Thu, 12 Oct 2006 12:55:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GXyDe-0002td-Hg for ged-emacs-devel@m.gmane.org; Thu, 12 Oct 2006 06:55:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GXyDL-0002tQ-K2 for emacs-devel@gnu.org; Thu, 12 Oct 2006 06:54:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GXyDL-0002tA-1O for emacs-devel@gnu.org; Thu, 12 Oct 2006 06:54:59 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GXyDK-0002t7-Ql for emacs-devel@gnu.org; Thu, 12 Oct 2006 06:54:58 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GXyLX-00039t-Mz for emacs-devel@gnu.org; Thu, 12 Oct 2006 07:03:27 -0400 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.34) id 1GXyDJ-00022t-VK; Thu, 12 Oct 2006 06:54:58 -0400 Original-To: David Kastrup In-reply-to: <85d58xq3xd.fsf@lola.goethe.zz> (message from David Kastrup on Thu, 12 Oct 2006 11:27:58 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:60645 Archived-At: > Cc: Eli Zaretskii , > Lennart Borgman , > emacs-devel@gnu.org > From: David Kastrup > Date: Thu, 12 Oct 2006 11:27:58 +0200 > > However, I agree that `shell-quote-argument' would be inappropriate to > apply on the arguments of `call-process-shell-command'. Only those > characters responsible for splitting arguments into words should get > quoted. What about < and | and ` and ' and ~ and ! etc.? Some, if not all of them also split arguments into words, and have other effects. We should leave this to the shell. Let's put it another way: an interface to invoking a shell eventually boils down to calling `system' or its equivalent. A call to `system' accepts a single string that is the command line to pass to the shell. So any API wrapped around `system' eventually concatenates all the portions of the command-line args into a single string, and that is how applications should use such an API. If one needs to pass several strings as separate arguments to a subprogram (including a shell), one should use an appropriate API, such as call-process.