Pretty-print for shell script

前端 未结 4 2157
小蘑菇
小蘑菇 2020-12-31 17:35

I\'m looking for something similiar to indent but for (bash) scripts. Console only, no colorizing, etc.

Do you know of one ?

4条回答
  •  萌比男神i
    2020-12-31 18:21

    Vim can indent bash scripts. But not reformat them before indenting.
    Backup your bash script, open it with vim, type gg=GZZ and indent will be corrected. (Note for the impatient: this overwrites the file, so be sure to do that backup!)

    Though, some bugs with << (expecting EOF as first character on a line) e.g.

    EDIT: ZZ not ZQ

提交回复
热议问题