From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Oleksandr Gavenko Newsgroups: gmane.emacs.help Subject: Re: GURU NEEDED : break a command into several lines and comment each line Date: Fri, 14 Jan 2011 10:07:28 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1294992499 27731 80.91.229.12 (14 Jan 2011 08:08:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 14 Jan 2011 08:08:19 +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 09:08:16 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 1Pdehj-00029i-6Z for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Jan 2011 09:08:15 +0100 Original-Received: from localhost ([127.0.0.1]:40900 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pdehi-0006OR-JB for geh-help-gnu-emacs@m.gmane.org; Fri, 14 Jan 2011 03:08:14 -0500 Original-Received: from [140.186.70.92] (port=59496 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pdeh9-0006Ng-4g for help-gnu-emacs@gnu.org; Fri, 14 Jan 2011 03:07:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pdeh8-00067e-7c for help-gnu-emacs@gnu.org; Fri, 14 Jan 2011 03:07:38 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:38350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pdeh8-000672-0b for help-gnu-emacs@gnu.org; Fri, 14 Jan 2011 03:07:38 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Pdeh5-0001rX-LF for help-gnu-emacs@gnu.org; Fri, 14 Jan 2011 09:07:35 +0100 Original-Received: from 91.193.68.214 ([91.193.68.214]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 14 Jan 2011 09:07:35 +0100 Original-Received: from gavenko by 91.193.68.214 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 14 Jan 2011 09:07:35 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 39 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 91.193.68.214 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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 X-Spam-Report: 5.4 points; * -0.0 SPF_PASS SPF: sender matches SPF record * 4.0 RCVD_NUMERIC_HELO Received: contains an IP address used for HELO * -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] * 4.0 RCVD_IN_SBL RBL: Received via a relay in Spamhaus SBL * [91.193.68.214 listed in zen.spamhaus.org] Xref: news.gmane.org gmane.emacs.help:78431 Archived-At: On 13.01.2011 23:18, bolega wrote: > Basically, I have spent a few hours experimenting and searching on the > comp.unix.shell > > how to break a command with several switches into more than one line > AND to be able to put some comment on each line. > > #!/bin/bash -xv > > command \ # comment1 > -sw1 \ # comment2 > -sw2 \ # comment3 > arguments > > One ought to be able to comment every single switch if desired for > whatever reason. > This is offtopic for this list. But seems POSIX shell do not support inline comments. You can use such trick (: is NOP command, but `` invoke shell, so consume CPU resource): $ printarg -x `: this opt allow x` \ -y `: this opt allow y` \ -z `: this opt allow z` "printarg" "-x" "-y" "-z" I put comments before command like (example from Makefile): # /O1 creates small code # /Oi- disable generate intrinsic functions (to save exe size) # /Oy omit frame pointer # /Gm- disable minimal rebuild OPTIM_CFLAGS = /O1 /Oi- /Oy /Gm-