
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tlug] Bourne / bash problem
On Sat, Apr 4, 2009 at 11:29 PM, Dave Brown <dagbrown@example.com> wrote:
>> > somewhere, I cannot escape the end-of line:
>> > [...]
>> > a-command \
>> > # a comment \
>> > another-command # another comment \
>> > [...]
>> >
>> > Do you think there would be a way to include comments in such a situation?
>
> Verified as not working in bash in my own experimentation. It would
> seem there's no way of interspersing comments with parameters, except
> possibly by (ugly) assigning them to variables and commenting that.
Thanks to all.
I eventually preferred to "sed" my whole set of commands (assuming there
is no "#" character used for anything else that comments). This seems more
readable than the "echo" tricks for me. I also avoid the need of "\" at the
end of lines.
Something like:
(
sed -e 's/#.*//' -e 's/$/\\/' << _EOF
command
--option 1
--option 2 # comment 2
# comment 3
--option 3
_EOF
) | sh
br.
--
2 + 2 = 5, for very large values of 2.
Home |
Main Index |
Thread Index