Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Which Program can reformat and indent ksh or sh shell script

1,133 views
Skip to first unread message

moonhkt

unread,
Mar 19, 2010, 9:09:03 PM3/19/10
to
Hi All

AIX 5.3

Which Program can reformat and indent ksh or sh shell script ?

moonhkt

Greg Russell

unread,
Mar 19, 2010, 9:30:20 PM3/19/10
to
"moonhkt" <moo...@gmail.com> wrote in message
news:881d260d-92ed-472e...@z1g2000prc.googlegroups.com...

> Which Program can reformat and indent ksh or sh shell script ?

awk '{print "\t"$0}' junk.sh


Chris F.A. Johnson

unread,
Mar 20, 2010, 1:43:18 AM3/20/10
to

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 =====

bsh

unread,
Mar 20, 2010, 1:51:57 PM3/20/10
to
On Mar 19, 6:09 pm, moonhkt <moon...@gmail.com> wrote:
> Under AIX 5.3, which program can reformat and indent

> ksh or sh shell script ?

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

moonhkt

unread,
Mar 21, 2010, 9:10:37 PM3/21/10
to
On 3月21日, 上午1時51分, bsh <brian_hi...@rocketmail.com> wrote:
> On Mar 19, 6:09 pm, moonhkt <moon...@gmail.com> wrote:
>
> > Under AIX 5.3, which program can reformat and indent
> > ksh or sh shell script ?
>
> 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/highlighterhttp://sf.net/docman/display_doc.php?docid=25740&group_id=114997http://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

0 new messages