https://bugs.kde.org/show_bug.cgi?id=512142
Bug ID: 512142
Summary: Example in custom script documentation does not handle
spaces in path
Classification: Applications
Product: digikam
Version First 8.9.0
Reported In:
Platform: Other
OS: Other
Status: REPORTED
Severity: normal
Priority: NOR
Component: Documentation
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
SUMMARY
Section found here:
https://docs.digikam.org/en/batch_queue/custom_script.html#proof-of-concept
In the context of a custom script, the variables `$INPUT` and `$OUTPUT` are
special. The are interpolated by digikam before executing the script. This
means that the script will evaluate to something like this before execution:
```
echo "INPUT FILE: "<path/to/input>""
echo "OUTPUT FILE: "<path/to/output>""
echo "TITLE: $TITLE"
echo "COMMENT: $COMMENT"
echo "COLORLABEL: $COLORLABEL"
echo "PICKLABEL: $PICKLABEL"
echo "RATING: $RATING"
echo "TAGSPATH: $TAGSPATH"
cp ""<path/to/input>"" ""<path/to/output>""
exit $?
```
This causes the quotes to cancel out and the copy to fail. Removing the quotes
from around `$INPUT` and `$OUTPUT` fixes the issue.
STEPS TO REPRODUCE
1. Run proof of concept from docs using a files with a space in the path.
OBSERVED RESULT
`cp` fails to run
EXPECTED RESULT
script executes correctly
--
You are receiving this mail because:
You are watching all bug changes.