Code: Select all
#!/bin/bash
# Set paths and files:
FINAL="/path/to/final"
WORKING="/path/to/working"
BACKP="/path/to/back_pages"
CABP="canada_back_page.pdf"
USBP="usa_back_page.pdf"
for f in $WORKING
do
echo "Processing $f ..."
if
# If file name ends in "_ca.pdf":
$f=.*_ca\.pdf$
# Figure out and set the new name:
NEW_NAME=s/\w{3}(?=\.\w+$)/""/
pdfunite $WORKING/$f $BACKP/$CABP $FINAL/$NEW_NAME.pdf
mv $WORKING/$f $WORKING/$NEW_NAME
fi
done
< /code>
Und hier ist die Ausgabe: < /p>
user@machine:~$ ./smash.sh
./smash.sh: line 22: syntax error near unexpected token `('
./smash.sh: line 22: ` NEW_NAME=s/\w{3}(?=\.\w+$)/""/'
user@machine:~$
./smash.sh: line 25: syntax error near unexpected token `fi'
./smash.sh: line 25: ` fi'
user@machine:~$
< /code>
Ideen? Danke.