On Thu, 6 Jun 2013, Erik Christiansen wrote:

> On 06.06.13 10:19, Tim Connors wrote:
> > On Wed, 5 Jun 2013, Erik Christiansen wrote:
> >
> > > On 04.06.13 23:45, Craig Sanders wrote:
> > > > spaces in filenames, OTOH, are quite common. especially if you have to
> > > > deal with files uploaded by Mac or Windows users.
> > >
> > > Although it's mostly xpdf which won't handle spaces in filenames,
> >
> > Eh?  WFM.
>
> Ah, you're having trouble understanding it. That's OK, just learn from
> what follows, and you'll catch up.
>
> > > I'm finding a simple alias useful for the few arriving here:
> > >
> > > alias unspace="/usr/bin/rename 's/ /_/g' "
> >
> > Isn't it easier just to fix your scripts (and evidentally your alias for
> > xpdf) and program defensively?
>
> Hopefully it'll be easier for you to understand if you fantasise less,
> and instead observe reality:
>
> $ cp Desktop/h-bridge_sch_pcb.pdf /tmp/h-bridge\ sch\ pcb.pdf
> $ /usr/bin/xpdf /tmp/h-bridge\ sch\ pcb.pdf
> Error: Couldn't open file '/tmp/h-bridge sch pcb.pdf'

Ah, I see, you're using an inferior OS.  Might want to submit a bug to
get them to pull the fixes that have been in upstream Debian for years
now.  Like I said, WFM:

> xpdf -m flex\ hours.pdf flex\ hours.pdf
> echo $? #wheee!
0

> Just in case there's been a recent fix, I did an apt-get install, but
> there's no improvement in the behaviour of the package.
>
> I see now, that some time ago I implemented this fix:
>
> $ which xpdf
> xpdf is a function
> xpdf ()
> {
>     if [[ $1 =~ ' ' ]]; then
>         fn=${1// /_};
>         mv "$1" $fn;
>     else
>         fn=$1;
>     fi;
>     /usr/bin/xpdf -geometry 1200x900+5+0 -z width -papercolor slategrey $fn &
> }
>
> so the rename example I posted as part of a wider discussion isn't needed
> here for this case.
>
> Hopefully you understand better now.

Not really.  In that case, I would have submitted a bug.  Not handling
shell script escaping properly is the mark of … something that leaves a
bad mark.  To have such bugs creep into an OS is just shitty.  They're
usually RC bugs in debian, because there's no excuse for such dangerous
programming.

-- 
Tim Connors
_______________________________________________
luv-main mailing list
[email protected]
http://lists.luv.asn.au/listinfo/luv-main

Reply via email to