Way to create multiline comments in Bash?

后端 未结 8 548
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-04 04:59

I have recently started studying shell script and I\'d like to be able to comment out a set of lines in a shell script. I mean like it is in case of C/Java :



        
8条回答
  •  生来不讨喜
    2020-12-04 05:28

    what's your opinion on this one?

    function giveitauniquename()
    {
      so this is a comment
      echo "there's no need to further escape apostrophes/etc if you are commenting your code this way"
      the drawback is it will be stored in memory as a function as long as your script runs unless you explicitly unset it
      only valid-ish bash allowed inside for instance these would not work without the "pound" signs:
      1, for #((
      2, this #wouldn't work either
      function giveitadifferentuniquename()
      {
        echo nestable
      }
    }
    

提交回复
热议问题