pdftk in script does not work: does in shell window.

pdftk in script does not work: does in shell window.

am 20.11.2007 02:00:06 von Gary Carroll

In a bash script I have the lines:

PDFTK $outfilename burst output $pth$TEAJOBID/%04d.pdf
echo PDFTK $outfilename burst output $pth$TEAJOBID/%04d.pdf >> $touchfile

When I run the script I get no burst pages. My error log reports
"PDFTK: command not found". However, if I
open the file specified in $touchfile and copy/paste the line that was
echoed into a terminal window, it works. Why might this not work in a
script but does in a terminal?


$outfilename=the input filename including path.
$pth$TEAJOBID/%04d.pdf = a path where the burst pages should go +
%04d.pdf to produce page-numbered output.
$touchfile=a file used to echo stuff for diagnostic purposes like this.
Helps find when I have screwed up by variable names or such.

Re: pdftk in script does not work: does in shell window.

am 20.11.2007 08:36:27 von Bill Marcum

On 2007-11-20, Gary Carroll wrote:
>
>
> In a bash script I have the lines:
>
> PDFTK $outfilename burst output $pth$TEAJOBID/%04d.pdf
> echo PDFTK $outfilename burst output $pth$TEAJOBID/%04d.pdf >> $touchfile
>
> When I run the script I get no burst pages. My error log reports
> "PDFTK: command not found". However, if I
> open the file specified in $touchfile and copy/paste the line that was
> echoed into a terminal window, it works. Why might this not work in a
> script but does in a terminal?
>
Check the value of $PATH when the script runs, especially if it is
started by cron. Or use the full pathname of PDFTK.

Re: pdftk in script does not work: does in shell window.

am 20.11.2007 16:37:25 von Gary Carroll

In article ,
Bill Marcum wrote:

> On 2007-11-20, Gary Carroll wrote:
> >
> >
> > In a bash script I have the lines:
> >
> > PDFTK $outfilename burst output $pth$TEAJOBID/%04d.pdf
> > echo PDFTK $outfilename burst output $pth$TEAJOBID/%04d.pdf >> $touchfile
> >
> > When I run the script I get no burst pages. My error log reports
> > "PDFTK: command not found". However, if I
> > open the file specified in $touchfile and copy/paste the line that was
> > echoed into a terminal window, it works. Why might this not work in a
> > script but does in a terminal?
> >
> Check the value of $PATH when the script runs, especially if it is
> started by cron. Or use the full pathname of PDFTK.

Thank you, the path was the problem. Use the full pathname to pdftk in
the script and it works. I will investigate why the search path is not
as expected in the script but is in the terminal shell.