Afficher un message
Vieux 11/09/2007, 18h17   #5
Icarus Sparry
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Error using "xargs eval"

On Tue, 11 Sep 2007 02:03:30 -0700, John wrote:

> On 7 Sep, 20:09, Icarus Sparry <use...@icarus.freeuk.com> wrote:
>
>> The answer to what you actually want is
>>
>> PARAM_mac=$(echo $PARAM_mac | sed "s/%3[Aa]/:/g" )
>>
>> or even
>>
>> PARAM_mac=${PARAM_mac//\%3[Aa]/:}
>>
>> if you have a nice modern bash/zsh/ksh

>
> Thanks! That satisfies my basic interest of not using the disk drive.
> But I'm still curious
> why xargs is designed not to be able to use inbuilt commands.


The question is simular to asking "why does the C compiler not use the
builtin commands of the shell?". xargs is a stand alone program, which
gathers up the input and executes commands. When it come to execute the
command it has got to find it, and you do not have a /bin/eval or a /usr/
bin/eval (and even if you did they would not work in the way that you
appear to hope they will).

There are other operating systems where the environment is either global
(MSDOS I think comes under this heading), or you can optionally share it
between processes (e.g. plan9), but unix is not one of these.
  Réponse avec citation
 
Page generated in 0,04979 seconds with 9 queries