On Sat, Nov 12, 2011 at 10:18 AM, Chet Ramey <chet.ra...@case.edu> 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