0

I want to manually comment and uncomment lines in a multi-line statement, within a script file. Consider for example:

./configure \
  --prefix /usr/local \
  --with-option1 \
  --with-option2

I want to be able to do something like this (basically, ignoring the option1 switch):

./configure \
  --prefix /usr/local \
  #--with-option1 \
  --with-option2

Is there a way to do it without deleting and undoing the delete?

Kap4Lin
  • 109
  • 5
  • 2
    There's some good answers here: [How to put a line comment for a multi-line command](https://stackoverflow.com/questions/9522631/how-to-put-a-line-comment-for-a-multi-line-command) – JNevill Jan 03 '22 at 16:47
  • Technically, it's not a comment that stays in there.. but I guess, a few more key strokes with ``#`` is not too bad. Thanks. – Kap4Lin Jan 03 '22 at 17:24
  • If you comment `--with-option1` with a `#` in your multi-line command then the `bash` syntax becomes invalid. – Cyrus Jan 03 '22 at 19:38

0 Answers0