BASH scripting problem
I am attempting to create a script that takes all the files in a directory "in", converts them to pdfs in an "out" directory, and creates a log file of the same name also in the "out" directory.
The script needs to be able to cope with space and control characters in the target file names.
the script I am using at the moment is:
for file in `ls in`
echo $file >> "out/$file.log"
date >> "out/$file.log"
# then create pdf files...
This creates the log files, but will wrap $file at any spaces.
I have tried using ls -Q, but this creates errors. I have also tried "`ls in`", but this creates a very long file name.
(and restricting file names is not an option...)