bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Parameter Expansion] bug in ${variable% *}


From: Dashing
Subject: Re: [Parameter Expansion] bug in ${variable% *}
Date: Tue, 12 Feb 2013 14:37:03 +0100

On Tue, 12 Feb 2013 14:16:24 +0100 "Greg Wooledge" 
<address@hidden> 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]