[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GURU NEEDED : break a command into several lines and comment each li
From: |
bolega |
Subject: |
Re: GURU NEEDED : break a command into several lines and comment each line |
Date: |
Thu, 13 Jan 2011 22:28:51 -0800 (PST) |
User-agent: |
G2/1.0 |
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
- GURU NEEDED : break a command into several lines and comment each line, bolega, 2011/01/13
- Re: GURU NEEDED : break a command into several lines and comment each line, suvayu ali, 2011/01/13
- Re: GURU NEEDED : break a command into several lines and comment each line, Pascal J. Bourguignon, 2011/01/13
- Re: GURU NEEDED : break a command into several lines and comment each line, Stefan Monnier, 2011/01/13
- Re: GURU NEEDED : break a command into several lines and comment each line,
bolega <=
- Re: GURU NEEDED : break a command into several lines and comment each line, Berthold Höllmann, 2011/01/14
- Re: GURU NEEDED : break a command into several lines and comment each line, David W. Hodgins, 2011/01/14