bug-findutils
[Top][All Lists]
Advanced

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

Re: Weird interaction of xargs with complete ( shell builtin )


From: Assaf Gordon
Subject: Re: Weird interaction of xargs with complete ( shell builtin )
Date: Thu, 27 Oct 2016 10:49:46 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

Hello,

On 10/27/2016 07:01 AM, Abhijith Sethuraj wrote:
cat file1 | xargs -I %% complete -A alias %%
xargs: complete: No such file or directory

As you,ve said, "complete" is a shell built-in (and even specific to bash).
xargs tries to run a program/script called 'complete' and fails.

To run a built-in shell command use:

    cat file1 | xargs -I% bash -c "complete -A alias %"

However that above will not do any good because
the changes made by 'complete' will only take hold in each invoked bash,
and will be promptly discarded.

If you want 'complete' to affect on your current shell session,
try:

    eval $(cat file1 | xargs -I% echo complete -A alias %)
or
    eval $(sed 's/^/complete -A alias /' file1)


regards,
 -assaf



reply via email to

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