AIX 5.3
Which Program can reformat and indent ksh or sh shell script ?
moonhkt
> Which Program can reformat and indent ksh or sh shell script ?
awk '{print "\t"$0}' junk.sh
Emacs (and probably other text editors).
--
Chris F.A. Johnson, author <http://shell.cfajohnson.com/>
===================================================================
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
===== My code in this post, if any, assumes the POSIX locale =====
===== and is released under the GNU General Public Licence =====
The programs or command lines that I have in my personal database
are:
$ sed 's/^[ ]*\(.*\)/\1/' FILE >xxx |
emacs xxx --eval '(indent-region (point-min) (point-max) nil)' -f save-
buffer # prettyprint shell script
codebt.c: "Code Beautifier: supports C/C++/Perl/shell/awk/BASIC"
http://codebt.sf.net/
fmt.pl: "prettyprint awk/csh/ksh/perl/sh"
http://www.linux-kheops.com/doc/perl/perl-aubert/fmt.script
fmtawksh.gawk: "prettyprint awk/ksh/sh"
ftp://ftp.armory.com/pub/scripts/fmtawksh
GeSHi.php: "GEneric Syntax HIghlighter -- prettyprinter: implements
bash+70; outputs .HTML"
http://sf.net/projects/geshi/
http://qbnz.com/highlighter
http://sf.net/docman/display_doc.php?docid=25740&group_id=114997
http://qbnz.com/blog
vgrind.ksh: "prettyprinter: configurable; requires dpost/lp/sed/troff/
vfontedpr"
http://cvs.opensolaris.org/source/xref/on/usr/src/cmd/vgrind/
Ironically, the best one is the one not appearing here: my own
prettyprinter utilizing my shellscript parser written in shellscript
--
Trapped on a dead workstation's harddrive *Sigh*.
shb.sh: "prettyprint k/sh(1): utilizes canon/qfilt/uncanon; component-
of side"
=Brian
Thank for your information.
Tried for fmt.pl: "prettyprint awk/csh/ksh/perl/sh"
http://www.linux-kheops.com/doc/perl/perl-aubert/fmt.script