我試圖根據我在某些頁面編號上找到的字符串將ptftk分割爲tempfile.pdf。那些pagenumbers在tempfile中。我在這裏用這些變量做錯了什麼?
n=0
prefix1="startpoint"
prefix2="stoppoint"
while read p; do
echo $p > temp
`cat temp` = prefix1$n
echo $((p-1)) > temp
`cat temp` = prefix2$n
n=$((n+1));
done < tempfile
pdftk tempfile.pdf cat $startpoint0-$stoppoint1 output $1/01-0.pdf
pdftk tempfile.pdf cat $startpoint1-$stoppoint2 output $1/02-0.pdf
pdftk tempfile.pdf cat $startpoint2-end output $1/03-0.pdf
出於某種原因,我得到這樣的錯誤:
/usr/local/bin/skapa_digital_akt: rad 16: 1: kommandot finns inte
/usr/local/bin/skapa_digital_akt: rad 18: 0: kommandot finns inte
/usr/local/bin/skapa_digital_akt: rad 16: 6: kommandot finns inte
/usr/local/bin/skapa_digital_akt: rad 18: 5: kommandot finns inte
/usr/local/bin/skapa_digital_akt: rad 16: 13: kommandot finns inte
/usr/local/bin/skapa_digital_akt: rad 18: 12: kommandot finns inte
Error: Unexpected range end; expected a page
number or legal keyword, here:
Exiting.
Errors encountered. No output created.
Done. Input errors, so no output created.
Error: Unexpected range end; expected a page
number or legal keyword, here:
Exiting.
Errors encountered. No output created.
Done. Input errors, so no output created.
Error: Input page numbers include 0 (zero)
The first PDF page is 1 (one)
Exiting.
Errors encountered. No output created.
Done. Input errors, so no output created.
顯然變量起始點/ stoppoint設置錯誤。任何人都可以幫助我?
非常感謝!
/保羅