Unix Shell - pdftk in script does not work: does in shell window.

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > November 2007 > pdftk in script does not work: does in shell window.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author pdftk in script does not work: does in shell window.
Gary Carroll

2007-11-19, 7:26 pm

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.
Bill Marcum

2007-11-20, 7:33 am

On 2007-11-20, Gary Carroll <garycarroll@nospamcharter.net> 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.

Gary Carroll

2007-11-20, 1:26 pm

In article <slrnfk53jq.6pi.marcumbill@lark.localnet>,
Bill Marcum <marcumbill@bellsouth.net> wrote:

> On 2007-11-20, Gary Carroll <garycarroll@nospamcharter.net> wrote:
> 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.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com