From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bolega Newsgroups: gmane.emacs.help Subject: Re: GURU NEEDED : break a command into several lines and comment each line Date: Thu, 13 Jan 2011 22:28:51 -0800 (PST) Organization: http://groups.google.com Message-ID: References: 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: dough.gmane.org 1294987267 7250 80.91.229.12 (14 Jan 2011 06:41:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 14 Jan 2011 06:41:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 14 07:41:03 2011 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.69) (envelope-from ) id 1PddLJ-0001xL-Qa for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Jan 2011 07:41:01 +0100 Original-Received: from localhost ([127.0.0.1]:38861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PddLJ-0002h1-92 for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Jan 2011 01:41:01 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!c39g2000yqi.googlegroups.com!not-for-mail Original-Newsgroups: comp.unix.shell,gnu.emacs.help Original-Lines: 30 Original-NNTP-Posting-Host: 75.28.139.69 Original-X-Trace: posting.google.com 1294986543 31329 127.0.0.1 (14 Jan 2011 06:29:03 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 14 Jan 2011 06:29:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c39g2000yqi.googlegroups.com; posting-host=75.28.139.69; posting-account=REkl4woAAABFXaU7nL79XtGpnmNCQ415 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6,gzip(gfe) Original-Xref: usenet.stanford.edu comp.unix.shell:249295 gnu.emacs.help:184257 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:78426 Archived-At: On Jan 13, 7:12=A0pm, Stefan Monnier wrote: > > #!/bin/bash -xv > > command =A0 =A0 =A0 \ # comment1 > > =A0 =A0 =A0 =A0 =A0-sw1 \ # comment2 > > =A0 =A0 =A0 =A0 =A0-sw2 \ # comment3 > > =A0 =A0 =A0 =A0 =A0arguments > > One ought to be able to comment every single switch if desired for > > whatever reason. > > Thanks for the riddle. =A0Here's a solution: > > =A0 command =A0 =A0 =A0 =A0$(: # comment1 > =A0 ) =A0 =A0 =A0 =A0-sw1 =A0$(: # comment2 > =A0 ) =A0 =A0 =A0 =A0-sw2 =A0$(: # comment3 > =A0 ) =A0 =A0 =A0 =A0arguments > > -- Stefan thanks to all four of you who replied and solved this problem to a large extent, building on each other's ideas. I would have done it by the first method of concatenating or pipes into a sed which replaced end by the next and # can be placed after pipes. the string then fed into a bash. Stefan, whats the purpose of the colon ? it works without colon also. Is it subshell or some environment import ? like the colon which can substitute the #!/bin/bash on the top ? Bolega