On Tue, 12 Feb 2013 14:16:24 +0100 "Greg Wooledge" <wool...@eeg.ccf.org> wrote: >On Mon, Feb 11, 2013 at 06:50:49PM +0100, Dashing wrote: >> $ ./pe 'mplayer foo1\ foo2\ foo3\ 4\ 5\ foo6\ 7' >> :--Mistake--: >> :--Mistake--: > >Whatever you're doing, it's wrong. > >./pe mplayer foo1\ foo2\ foo3\ 4\ 5\ foo6\ 7 > >#!/bin/bash >prog=$1 >shift >exec "$prog" extra args go here "$@" > >THAT is how a wrapper should be done. Do not combine a program >and its >arguments all together into a single argument and then try to >parse it >apart.
For my purposes this is irrelevant, because the nature of the script from which my example code derived is tab completion. READLINE_LINE will contain mplayer foo1\ foo2\ etc. The last argument needs to be found and if it contains spaces this is what needs to happen.