🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #4088

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

#4088
From: Stefan Monnier
Date: Fri, 14 Jan 2011 03:12
19 lines
1718 bytes
> #!/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
Technical Details
Message-ID: <jwvaaj4b2sb.fsf-monnier+gnu.emacs.help@gnu.org>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
References: <bfd24856-94a9-4b46-b0b7-8c142f5b87f5@z5g2000yqb.googlegroups.com>

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-Thread: 10dd18,20180ee9ccee5478
X-Google-NewGroupId: yes
X-Google-Attributes: gid9d2148d7bf,gid39ae015015,gidc8df1ae2c2,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: Stefan Monnier <monnier@iro.umontreal.ca>
Newsgroups: comp.unix.shell,gnu.emacs.help,comp.lang.python
Subject: Re: GURU NEEDED : break a command into several lines and comment each line
Date: Thu, 13 Jan 2011 22:12:30 -0500
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <jwvaaj4b2sb.fsf-monnier+gnu.emacs.help@gnu.org>
References: <bfd24856-94a9-4b46-b0b7-8c142f5b87f5@z5g2000yqb.googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: mx02.eternal-september.org; posting-host="8jSoPKcnI4RsJz0v4H4pBg";
 logging-data="18262"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/3FYI+p3gAygWkcnCrE4y6"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
Cancel-Lock: sha1:8ZFdoGwRoUWHqFJ44CBkWstG5u8=
 sha1:AtA4pStufTYVNW15NnLChyzB0JU=