bug-bash
[Top][All Lists]
Advanced

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

Completion crashes the shell


From: Chris F.A. Johnson
Subject: Completion crashes the shell
Date: Mon, 2 Mar 2009 13:56:19 -0500 (EST)
User-agent: Alpine 1.00 (LRH 882 2007-12-20)


    This completion function worked in previous versions, but fails in
    bash4.0 when I press TAB:

_cpsh() {
    COMPREPLY=( `
        cd "$HOME/scripts" || return 3
        printf "%s\n" ${COMP_WORDS[$COMP_CWORD]}*-sh`
    )
    COMPREPLY=( "${COMPREPLY[@]%-sh}" )
  }
complete -F _cpsh cpsh


     This is what happens:

$ cpsh <TAB>
malloc: ./parse.y:5563: assertion botched
free: called with unallocated block argument
last command: _cpsh() {
  COMPREPLY=( `
      cd "$HOME/scripts" || return 3
      printf "%s\n" ${COMP_WORDS[$COMP_CWORD]}*-sh`
  )
  COMPREPLY=( "${COMPREPLY[@]%-sh}" )
}
Aborting...Aborted

--
   Chris F.A. Johnson, webmaster         <http://woodbine-gerrard.com>
   ===================================================================
   Author:
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)




reply via email to

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