bug-bash
[Top][All Lists]
Advanced

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

Re: Why complete doesn't print anything if it is called in a bash script


From: Peng Yu
Subject: Re: Why complete doesn't print anything if it is called in a bash script?
Date: Sat, 12 Nov 2011 10:25:25 -0600

On Sat, Nov 12, 2011 at 10:18 AM, Chet Ramey <address@hidden> wrote:
> On 11/12/11 10:41 AM, Peng Yu wrote:
>> Hi,
>>
>> It is strange to me why complete doesn't print anything when it is
>> called in a bash script. I must have misunderstood some fundamentals.
>> Does anybody know why? Thanks!
>
> Since complete happily shows completions when run from a shell script,
> there must be code in your bashrc that prevents them from being
> defined if the shell is not interactive.

Thank you for reminding me! That's indeed the case (shown below is
from the bashrc file).

case $- in
  *i*) [[ -f /opt/local/etc/bash_completion ]] && .
/opt/local/etc/bash_completion ;;
esac

-- 
Regards,
Peng



reply via email to

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