pretty打印的shell脚本 [英] Pretty-print for shell script

查看:202
本文介绍了pretty打印的shell脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找类似的东西来缩进但(bash)的脚本。控制台只,无彩色化等。

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

你知道一个?

推荐答案

Vim可以缩进的bash脚本。但是缩进之前没有格式化。结果
备份您的bash脚本,用vim打开它,键入 GG = GZZ 和缩进将得到纠正。 (注意不耐烦:这将覆盖该文件,所以一定要做好备份)

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!)

不过,一些错误与<< (EOF期待作为行首字符)的例如

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

编辑:ZZ不ZQ

这篇关于pretty打印的shell脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆