Over a million developers have joined DZone.

Collective Pretty Printing C/C++

DZone's Guide to

Collective Pretty Printing C/C++

Free Resource
Pretty Print all C/C++ and headers into ONE file each.

#!/bin/sh -

echo 'Pretty Print Script v0.2 by s tayefeh (2004)'
echo 'collects all .C .cc .cpp and .h from a ./.'
echo 'and create a PRETTY_C.ps file with the C-sources'
echo 'and a PRETTY_h.ps file with the header-sources'

ls -lq *.C *.cc *.cpp \
        | awk '{printf "%s ", $8}' \
        > clist.temp

ls -lq *.h \
        | awk '{printf "%s ", $8}' \
        > hlist.temp

a2ps --prologue=color -Ec++ -o PRETTY_C.ps \
`cat clist.temp` $1 $2 $3 $4

a2ps --prologue=color -Ec++ -o PRETTY_h.ps \
`cat hlist.temp` $1 $2 $3 $4

rm hlist.temp clist.temp


Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}