Over a million developers have joined DZone.

Pretty Print All Header And C++ Files In A Directory

·

#!/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

Topics:

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

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

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

{{ parent.tldr }}

{{ parent.urlSource.name }}