🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #4089

Re: GURU NEEDED : break a command into several lines and comment each line

#4089
From: bolega
Date: Fri, 14 Jan 2011 06:28
30 lines
2507 bytes
On Jan 13, 7:12 pm, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
> > #!/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.
>
> Thanks for the riddle.  Here's a solution:
>
>   command        $(: # comment1
>   )        -sw1  $(: # comment2
>   )        -sw2  $(: # comment3
>   )        arguments
>
> -- 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
Technical Details
Message-ID: <b6837579-c757-41be-bbb5-33a91849d962@c39g2000yqi.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!c39g2000yqi.googlegroups.com!not-for-mail
References: <bfd24856-94a9-4b46-b0b7-8c142f5b87f5@z5g2000yqb.googlegroups.com> <jwvaaj4b2sb.fsf-monnier+gnu.emacs.help@gnu.org>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1012a6,20180ee9ccee5478
X-Google-NewGroupId: yes
X-Google-Thread: 103b8b,20180ee9ccee5478
X-Google-NewGroupId: yes
X-Google-Attributes: gid9d2148d7bf,gid39ae015015,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII
Path: arc1-ca.pugleaf.net!g2news2.google.com!postnews.google.com!c39g2000yqi.googlegroups.com!not-for-mail
From: bolega <gnuist006@gmail.com>
Newsgroups: comp.unix.shell,gnu.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
Lines: 30
Message-ID: <b6837579-c757-41be-bbb5-33a91849d962@c39g2000yqi.googlegroups.com>
References: <bfd24856-94a9-4b46-b0b7-8c142f5b87f5@z5g2000yqb.googlegroups.com> <jwvaaj4b2sb.fsf-monnier+gnu.emacs.help@gnu.org>
NNTP-Posting-Host: 75.28.139.69
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1294986543 31329 127.0.0.1 (14 Jan 2011 06:29:03 GMT)
X-Complaints-To: groups-abuse@google.com
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)