Skip to main content
deleted 38 characters in body
Source Link
ingopingo
  • 807
  • 5
  • 7

Create a java2pdfjava2ps script to easying the parameter handling

#!/bin/bash

export ENSCRIPT="
--portrait
--columns=1
--font=Courier8
--highlight=java
--color
--line-numbers
--output=-
"
 
echo "creating $1.pdf"

iconv -f utf-8 -t iso-8859-1 "$1" \
| enscript --header=' $n|'"$1"'|%F  Page $% of $=' \
| ps2pdf - "$1.pdf"

Now, the execution is simple

find -name '*.java' -type f -exec ~/java2pdfjava2ps {} \; | ps2pdf - > all.pdf

Create a java2pdf script to easying the parameter handling

#!/bin/bash

export ENSCRIPT="
--portrait
--columns=1
--font=Courier8
--highlight=java
--color
--line-numbers
--output=-
"
 
echo "creating $1.pdf"

iconv -f utf-8 -t iso-8859-1 "$1" \
| enscript --header=' $n|'"$1"'|%F  Page $% of $=' \
| ps2pdf - "$1.pdf"

Now, the execution is simple

find -name '*.java' -type f -exec ~/java2pdf {} \;

Create a java2ps script to easying the parameter handling

#!/bin/bash

export ENSCRIPT="
--portrait
--columns=1
--font=Courier8
--highlight=java
--color
--line-numbers
--output=-
"

iconv -f utf-8 -t iso-8859-1 "$1" \
| enscript --header=' $n|'"$1"'|%F  Page $% of $='

Now, the execution is simple

find -name '*.java' -type f -exec ~/java2ps {} \; | ps2pdf - > all.pdf
Source Link
ingopingo
  • 807
  • 5
  • 7

Create a java2pdf script to easying the parameter handling

#!/bin/bash

export ENSCRIPT="
--portrait
--columns=1
--font=Courier8
--highlight=java
--color
--line-numbers
--output=-
"

echo "creating $1.pdf"

iconv -f utf-8 -t iso-8859-1 "$1" \
| enscript --header=' $n|'"$1"'|%F  Page $% of $=' \
| ps2pdf - "$1.pdf"

Now, the execution is simple

find -name '*.java' -type f -exec ~/java2pdf {} \;