Groups | Search | Server Info | Login | Register


Groups > alt.comp.lang.shell.unix.bourne-bash > #244

Problems handling spaces in filenames

From Philipp Klaus Krause <pkk@spth.de>
Newsgroups alt.comp.lang.shell.unix.bourne-bash
Subject Problems handling spaces in filenames
Date 2019-01-26 21:36 +0100
Organization solani.org
Message-ID <q2igcd$9t6$1@solani.org> (permalink)

Show all headers | View raw


I rarely write bash scripts, so I am not surprised I ran into trouble
with spaces in filenames in one:

#!/bin/bash
for i in `seq $2 $3`; do
	base=$1-$i
	image=${base}.jpeg
	pdflist="${pdflist} \"$base.pdf\""
	tesseract "$image" "$base" -l deu pdf;
done
pdfjoin $pdflist && rm $pdflist
mv "$1"-"$3"-joined.pdf "$1".pdf

I wrote and use this script to convert JPEG images (names e.g.
test-1.jpeg, test-2-jpeg, etc) to searchable pdf (names test.pdf).
However, the

pdfjoin $pdflist

isn't working when $1 contains spaces. Apparently the quotes are
disappearing somewhere along the way.

Philipp

Back to alt.comp.lang.shell.unix.bourne-bash | Previous | NextNext in thread | Find similar


Thread

Problems handling spaces in filenames Philipp Klaus Krause <pkk@spth.de> - 2019-01-26 21:36 +0100
  Re: Problems handling spaces in filenames Joe Rosevear <Joe_Rosevear@localhost.invalid> - 2019-06-15 20:23 +0000
  Re: Problems handling spaces in filenames Stephane Chazelas <stephane.chazelas@gmail.com> - 2019-10-22 22:14 +0100

csiph-web